In a game that featured 10 lead changes, it looked like the team that had the ball last was going to win Saturday at Lincoln Financial Field. That’s what happened as UCF (8-1, 5-0 American) picked up a heart-stopping, come-from-behind 39-36 victory over Temple (1-9, 0-6) to remain alone in first place in the American Athletic Conference.

The Knights trailed 36-29 with 2:04 remaining in the contest. But the Knights engineered a game-tying drive, going 70 yards in just four plays. The touchdown came on a 30-yard pass to J.J. Worton from Blake Bortles. Worton has made some huge, tough catches in his career. But this one-handed grab with full extension in the back of the end zone almost defied words.

“Honestly it’s a blur right now to me,” Worton said after the game. “Everyone is talking about it. I’ll have to see if on film to remember it. I remember I caught it and after that everyone else was yelling and crazy. All glory to God right now. I couldn’t be more happy with the team right now. It’s a great day for UCF.”

But that play only tied the game.

Temple got the ball back with 60 seconds remaining and moved out toward midfield. But a pair of sacks ended the Owls’ possession and the punted to UCF. The Knights had it at their own 30-yard line with 19 seconds remaining and it looked like overtime was a certainty. But Bortles and Rannell Hall had other ideas. Bortles hit Hall for a 64-yard catch and run down to the Temple 6-yard line. The Knights, without any time outs remaining, had to sprint downfield and spike the ball to stop the clock and bring on Shawn Moffitt for the potential game-winning field goal.

“We got the ball back with another opportunity and Speedy (Hall) was the guy,” Bortles said. “It was just taking advantage of our opportunities.

Moffitt took the field with two seconds remaining and calmly drilled the kick as time expired, giving UCF the three-point victory.

“I’ve never had one before,” Moffitt said of his game-winning field goal. “I’m glad I got the opportunity. My holder, my snapper … I love them. They all picked me up afterward. It was just a great feeling.”

Head coach George O’Leary said victories don’t usually happen like that. But he and the Knights are certainly thankful for the win.

“I told the players when they go to church tomorrow, make sure they’re in the front pew,” O’Leary said. “Somebody’s looking out for them. That’s why you never, never give up. That’s the resiliency of the team. It worked out well. It’s a good win. It’s not the prettiest of wins. But we made some big-time plays at the end of that game.”

Bortles completed 27 of his 38 pass attempts for a career-best 404 yards and four touchdowns. It was the 10th-best passing day in UCF history. Worton recorded 179 receiving yards and three touchdowns, both career-best marks. Hall had a career-best 159 yards receiving, as well. Storm Johnson rushed for 122 yards to lead the ground game. UCF rolled up 657 yards of offense, while Temple piled up 518 yards of its own.

The Knights led 29-28 on Worton’s second TD reception of the day. But Temple wouldn’t go away. Owls’ quarterback P.J. Walker engineered an eight-play, 80-yard drive, capped by a 7-yard toss to Chris Parthemore. Another Walker-to-Parthemore connection on the 2-point conversion put the Owls up 36-29.

Walker passed for 382 yards and four touchdowns, completing 26-of-44 attempts with one interception to lead Temple’s offensive output.

UCF opened the scoring with a safety. Punter Caleb Houston pinned Temple at its own 1-yard line. Two plays later, Troy Gray stuffed Zaire Williams in the end zone to give the Knights a 2-0 lead midway through the first quarter. UCF went up 5-0 on a Shawn Moffitt 20-yard field goal three minutes later.

Temple took the lead 7-5 early in the second quarter when running back Jamie Gilmore hauled in a 32-yard pass from quarterback Walker. UCF quickly regained the advantage as William Stanback took a screen pass from Bortles 49 yards to make it 12-7. Walker rushed three yards for a score with 6:15 left in the first half to put the Owls on back on top 14-12. Storm Johnson and the Knights answered quickly. Johnson went 73 yards around the left end to give the Knights a first-and-goal at the Temple 8-yard line. Three plays and a holding penalty later, Bortles found Worton for a 4-yard TD pass to put UCF back on top 19-14.

But the wild second quarter wasn’t over yet. Walker and Robby Anderson responded almost as quickly for Temple with a 30-yard touchdown pass, putting Temple back in front 21-19. UCF capped the back-and-forth first half with a 35-yard field goal off the foot of Moffitt to take a 22-21 advantage into the halftime intermission.

Walker hit Anderson for a 75-yard touchdown late in the third quarter, putting Temple on top 28-22. The drive went 99 yards in five plays, after UCF failed to score on a fourth-and-goal at the Temple 1-yard line on its previous possession. The Owls took that six-point lead into the fourth quarter.

Trailing 28-22 more than halfway through the fourth quarter, Bortles led an 84-yard scoring drive. He capped the drive with a 38-yard toss to Worton. Moffitt’s PAT put UCF on top 29-28 with 6:15 remaining, setting up the wild finish.