Bortles threw a 2-yard touchdown pass to Jeff Godfrey with 23 seconds remaining, and the Knights stunned the Cardinals with a 38-35 victory Friday night, ending Louisville's perfect start.
"I said, 'Let's get some 2-minute calls ready,'" Bortles said. "We knew we were going to have to go 2-minute. ... Our offensive line did a great job, and our receivers did a great job of getting yards after the catch."
Down 28-7 midway through the third quarter, the Knights (5-1, 2-0 American Athletic Conference) responded with three touchdowns in a 7:22 span. Storm Johnson had a 1-yard TD run and a 20-yard reception for another score, and William Stanback ran 12 yards for the tying TD.
UCF then went in front on Shawn Moffitt's 34-yard field goal with 7:36 remaining.
Louisville (6-1, 2-1) reclaimed the lead on Dominique Brown's 15-yard run with three minutes to go, but the Knights drove 75 yards in 11 plays to take the lead for good on Bortles' TD and then held off the Cardinals' comeback attempt.
Bridgewater made one last desperate heave into the end zone as time expired, but the Heisman Trophy contender was unable to find anyone. The Knights then rushed the field in jubilation as a small gathering of fans in one section chanted, "UCF, UCF!"
"What can you say? It was a heck of a game," Knights coach George O'Leary said. "Both teams played their hearts out. That was a great drive, and it was a great win in a tough environment.
"Obviously, it's a big win. It's a big win because of the conference. We had great effort and great execution. ... We could have hung our heads, but we got after it."
Bortles finished 21-of-32 passing for 250 yards and two touchdowns while Johnson rushed for 109 yards and a TD on 18 carries, leading a spirited comeback during which the Knights outgained the Cardinals 269-210 in the second half to finish with a 446-445 edge.
It was Central Florida's second win over a ranked team in 27 attempts. It came in the lone conference meeting between the schools; the Cardinals are headed to the Atlantic Coast Conference next season.
"It felt good seeing that clock hit zero," Godfrey said in an elated Knights locker room. "It was a great feeling inside, a great win for the program and UCF Nation."
Struggling against a defense that entered the night allowing a nation-best 7.3 points per game and ranked No. 2 against the run, UCF eventually found room to run when Johnson started to cut and bounce his way to extra yardage.
Bortles chipped in with crisp passing, especially on the 20-yard pass to Johnson following a fumble recovery on the Cardinals' 15.
The combination of Johnson and Bortles ruined Louisville's homecoming and its 100th game at Papa John's Cardinal Stadium before a crowd of 55,215.
"You can't live in misery or live in a loss," Bridgewater said after the Cardinals' first loss since last November to Connecticut. "We are the type of team that has mature guys, and I am pretty sure our guys are switching their focus to South Florida. One loss doesn't determine the whole season."
Bridgewater finished 29-of-38 passing for 341 yards and two touchdowns. He welcomed back top receiver DeVante Parker from a shoulder injury, connecting for a 29-yard pass on Louisville's opening drive.
Bridgewater also went to former high school teammate Eli Rogers, who finished with 10 receptions for 95 yards, including an 18-yard touchdown that gave Louisville a 7-0 lead.
Ryan Hubbell's fumble that hit the pylon for a touchback and a punt on the next drive prevented the Cardinals from expanding the lead, and UCF scored on its fifth possession.
Johnson's 23-yard reception helped prolong the 71-yard drive, but Stanback's recovery of Rannell Hall's fumble at the 4 turned out to be the key play. Stanback scored on the next play.
Louisville responded with a 10-play, 75-yard drive ending with Bridgewater's 10-yard TD pass to Parker in double coverage just before halftime. The Cardinals then emerged from the locker room to drive 75 yards for a 21-7 lead on Brown's 20-yard touchdown run up the middle.
"We tell our kids to never, never give up," O'Leary said. "Our kids were jumping to the music. I knew we were going to be OK.
"We had a couple of good things happen, and it lit a fire."