ORLANDO — Playing pinball football, Temple did its best to stop college football's hottest team, but the Owls simply had no answers for the prolific Central Florida offense.

For the second game in a row Temple faced an undefeated ranked team, but unlike its 24-17 overtime win over Cincinnati, this one had a different ending.

With 312 yards passing and 318 yards rushing, No. 9 UCF defeated Temple, 52-40 in Thursday's American Athletic Conference shootout for first place.

"The story of the game was we outgained them, but when we look at the penalties and we hurt ourselves in the red zone," Temple coach Geoff Collins said.

The Owls were penalized 14 times for 149 yards.

Temple fell to 5-4, 4-1 in the AAC, while UCF sits alone in the East Division  with an 8-0, 5-0 mark. It was the Knights' 21st consecutive win, extending the longest Football Bowl Subdivision streak.

Temple squandered a record-setting offensive performance. The Owls outgained UCF, 670-630 in total yards. The old Temple record for total yards in a game was 622 set in 1974 against Southern Illinois.

Temple scored 5 of 7 times in the red zone, including four touchdowns. UCF was 7 for 7, with six touchdowns.

"They were going really fast and we weren't executing how we should have," said Temple safety Delvon Randall, who left the game twice, when he got the wind knocked out of him and then for cramps, but returned both times.

Temple quarterback Anthony Russo completed 31 of 52 for 444 yards and four touchdowns, with two interceptions. Russo also rushed for 46 yards and a score.

"I think this was a coming out party for the offense," Russo said.

Still, he was disappointed that the Owls didn't score even more.

"We have to do a better job in the red zone," he said, reiterating Collins' point.

UCF's McKenzie Milton completed 17 of 33 passes for 312 yards, three touchdowns, and one interception. Milton missed the previous game with an undisclosed injury, but a player who finished eighth in last year's Heisman Trophy voting, showed no rust.

Temple held four leads in the first half and was ahead, 34-28, at halftime. But it didn't take UCF long to overtake the Owls.  Opening the second half, UCF took four plays to drive 66 yards in just 50 seconds. Running back Greg McRae (188 yards rushing) gained all of the yards, including 32 for the touchdown.

It was the 21st straight game the Knights have scored 30 or more points.

The Knights extended the lead to 42-34 with 3:52 left in the third quarter, when Milton found tight end Michael Colubiale for his second touchdown pass, a 19-yarder.

Trailing, 42-34 at the start of the fourth quarter, Temple's Will Mobley's was wide left on a 40-yard field goal attempt. He has earlier made a 41-yarder.

But Temple got the ball back on Randall's interception at the Owls 33-yard line, and drew to within 42-40 on Russo's 8-yard scoring pass to Ventell Bryant — their second touchdown connection of the game — with 9:44 remaining. Temple went for the two-point conversion, but Jager Gardner was stopped just short of the end zone by A.J. Wooten after catching a swing pass.

Bryant, who hails from Tampa, had seven receptions for 109 yards and the two scores.

UCF then scored on the next possession, with Taj McGowan busting up the middle for a 10-yard run, making it 49-40 with 8:16 left.

After Temple failed to score on its next possession, UCF sealed the win with a Matthew Wright 32-yard field goal, making it 52-40 with 1:36 left.

Temple had a few key injuries. Center Matt Hennessy, who entered the game having not allowed a pressure all season, left with an undisclosed injury in the third quarter.

Running back Ryquell Armstead, who missed the two previous games with an ankle injury, departed in the fourth quarter when it appeared he hurt the ankle. He rushed for 142 yards on 27 carries.

The teams kept going back and fourth in the first half. Russo threw three first half TDs, 18 yards to Branden Mack, 70 yards hitting Randle Jones in stride and 15 yards to Bryant that gave the Owls a 34-28 lead with 18 seconds left in the first half.

Russo, the holder for field goals, even ran for a 5-yard score early in the second quarter on a fake field goal attempt. That gave Temple its biggest lead, 24-14 with 13:52 left in the second quarter.

Each time the Knights kept storming back.