Keisean Henderson threw a 42-yard touchdown pass to Koby Young with 53 seconds remaining, then Jonathan Dimas kicked a 50-yard field goal as time expired to give No. 18 Houston a 30-27 win over Baylor on Saturday night.

Houston (9-3, 6-3 Big 12) finished the season unbeaten at home, going 6-0. The Cougars had taken a 14-0 lead on touchdown runs by Makhi Hughes and Henderson, but Baylor rallied to lead 27-17 late in the game.

Caden Knighten put the Bears ahead with a 9-yard touchdown run, his third of the game, with 1:22 left. On Houston’s next possession, Young drew a pass-interference penalty on Baylor’s Levar Thornton Jr. Three plays later, Henderson found Young in tight coverage in the right corner of the end zone.

Henderson threw for 265 yards and accounted for two touchdowns in his second career start. The freshman started for the second straight week while Conner Weigman was sidelined with an injured right shoulder.

Houston had one second left after Amare Thomas caught a 26-yard pass and fell to the turf. Dimas made the field goal for his second walk-off kick in as many weeks, following a 23-yard field goal that gave the Cougars a 34-31 win over West Virginia a week earlier.

The late rally spared Houston what would have been its fourth loss of the season after blowing a double-digit lead. The game had been low-scoring for much of the night, with the teams combining for four field goals in the second half before scoring touchdowns 29 seconds apart late in regulation.

NO. 18 HOUSTON 30, BAYLOR 27 Baylor: 0, 13, 3, 11 — 27 Houston: 14, 0, 3, 13 — 30 First quarter HOU — Hughes 23 run (Dimas kick), 6:34. HOU — K. Henderson 1 run (Dimas kick), 1:36. Second quarter BAY — Knighten 9 run (kick blocked), 14:55. BAY — Knighten 74 run (Armstrong kick), 7:56. Third quarter HOU — Dimas 25 field goal, 8:52. BAY — Armstrong 39 field goal, 5:03. Fourth quarter HOU — Dimas 32 field goal, 14:57. BAY — Armstrong 29 field goal, 4:59. BAY — Knighten 9 run (Lagway run), 1:22. HOU — K. Young 42 pass from K. Henderson (Dimas kick), :53. HOU — Dimas 50 field goal, :00. Team statistics (Baylor, Houston) First downs: 21, 30 Total net yards: 466, 540 Rushes-yards: 28-200, 54-275 Passing: 266, 265 Punt returns: 2-19, 0-0 Kickoff returns: 2-50, 0-0 Interceptions returned: 1-9, 1-0 Completions-attempts-interceptions: 20-39-1, 20-30-1 Sacks-yards lost: 2-20, 4-28 Punts: 5-43.2, 4-45.75 Fumbles-lost: 1-0, 1-0 Penalties-yards: 5-48, 4-25 Time of possession: 23:13, 36:47 Individual statistics Rushing — Baylor: Knighten 12-133, Pendergrass 3-26, M. Turner 1-24, Morris 7-20, Lagway 5-(minus 3). Houston: K. Henderson 17-93, Hughes 24-93, Sanford 11-74, Butler 1-8, K. Young 1-7. Passing — Baylor: Lagway 20-39-1-266. Houston: K. Henderson 20-30-1-265. Receiving — Baylor: Freeman 9-90, Jad. Porter 3-61, McGowan 2-56, M. Turner 2-8, Brown 1-21, Livingston 1-16, Polley 1-12, Pendergrass 1-2. Houston: A. Thomas 7-79, Overmyer 5-46, K. Young 3-62, T. Walker 3-51, Sanford 1-22, Hughes 1-5. Missed field goals: None.