HOUSTON (AP) — After scoring to start the fourth quarter, No. 25 Memphis was up by 20 and looked well on its way to a big win over undefeated Houston.

The Tigers were left stunned less than 15 minutes later.

Backup quarterback Kyle Postma rushed for the go-ahead score and threw for a touchdown to rally No. 16 Houston to a 35-34 last-minute win on Saturday night.

Postma came in just before halftime when Greg Ward Jr. left with what appeared to be a left ankle injury. He went 21 of 33 for 236 yards and carried six times for 49 yards.

His 7-yard touchdown run with 1:27 left capped a nine-play, 77-yard drive to give Houston the lead.

"Everyone is heartbroken; things like this come a dime a dozen," Memphis linebacker Wynton McManis said. "Sometimes you win them, sometimes you lose them. It was very quiet (in the locker room), and people are down."

Jake Elliott missed a 48-yard field goal wide right with 19 seconds left, sealing the win for Houston (10-0, 6-0 American, No. 24 CFP).

"There's no one play that wins or loses a ballgame," Memphis coach Justin Fuente said. "You put yourself in those situations enough and work hard and sometimes those things happen."

Memphis had sacked Ward five times, and he hobbled off the field with 1:21 left in the first half after being sacked by Wynton McManis. In came Postma, who tossed a 30-yard score to Linell Bonner with 37 seconds left in the half to cut the lead to 20-7.

Paxton Lynch was 20-of-31 passing for 278 yards and two touchdowns for Memphis (8-2, 4-2, No. 21 CFP). Alan Cross caught a TD pass of 38 yards and Doroland Dorceus grabbed another for 61, both in the second quarter. Lynch also rushed for 43 yards.

"Obviously, everyone is upset because we were up pretty big, and we just let it get away from us," Lynch said. "Turnovers hurt us, and they're very good at taking the ball away. They're a great team."

Elliott had made field goals of 41 and 30 yards in the first half before missing in the final seconds.

Dorceus had 116 yards on 26 carries with a 6-yard touchdown run halfway through the third quarter. Tevin Jones also had a 25-yard TD run to give the Tigers a 34-14 lead to start the fourth quarter.

"There are a lot of plays in the game that ultimately determine the outcome," Fuente said. "It wasn't the last play, and it wasn't first play. There was just a bunch. Both teams were out there battling, competing. We came up a little short."

DeMarcus Ayers had 13 catches for 127 yards, and Kenneth Farrow had 10 carries for 46 yards and two touchdowns for Houston.

With 12:56 remaining, Farrow punched it in from 10 yards out to cut the Tigers' lead to 34-21.

Houston had a chance to narrow the gap following a Memphis fumble, but the Cougars had a touchdown negated by offsetting penalties, and Postma overthrew his receiver on fourth down from the 6.

Following a Lynch interception, Javin Webb cut the lead to 34-28 on a 1-yard touchdown run with 5:49 left.

After a Memphis three-and-out, Postma led the drive to give the Cougars the lead.

"Previously, we had turned the ball over I think a total of nine times, and we did a great job until the end," Lynch said. "They did a great job of taking it away, and we just didn't cover it up."

Farrow sliced the Memphis lead to 20-14 with a 7-yard touchdown run in the third quarter.

Houston did not get a first down until five minutes to go in the first quarter. The Tigers outgained the Cougars 273-99 yards in the first half.

Houston had 11 rushes for minus 13 yards as a team in the first half. The Cougars finished with 96 rushing yards.

The Texans' JJ Watt and DeAndre Hopkins, former major league pitcher Roger Clemens, who spent three seasons with the Astros and pitched for the Texas Longhorns, and Houston rapper Bun B were part of a record crowd of 42,159 at TDECU Stadium.