UCF (7-2, 4-1 American Athletic Conference) handed Memphis (4-5, 2-4) its fourth consecutive loss, the Tigers' longest losing streak since 2013.
Keene was pressed into his first start of the season after quarterback John Rhys Plumlee suffered an injury in last weekend's upset of nationally ranked Cincinnati. Plumlee sustained a possible concussion in UCF's 25-21 victory over the Bearcats.
''I haven't been playing consistently for a little bit, but nonetheless we prevailed,'' Keene said. ''I've been preparing like I was the starter, but it's always a little bit different coming out there. We had to fight through and that's what championship teams do.''
Keene rallied the Knights, who were held scoreless in the third quarter, by tossing two fourth-quarter touchdowns. The first was a 13-yard pass to Kobe Hudson early in the fourth quarter for a 28-21 UCF lead.
Hudson's second TD reception of the game came after the Knights stopped the Tigers on downs at the UCF 39 in the closing minutes of the third quarter. Keene added his third TD pass - and second of the quarter -- with 4:58 left by finding Javon Baker on a perfect strike to the left corner of the end zone for a 35-21 advantage.
''Mikey stepped in and handled himself like a champ like we thought he would,'' said UCF coach Gus Malzahn.
Malzahn said Plumlee, an Ole Miss transfer, could have played, but hadn't practiced much until late in the week.
''I just felt real strong that we needed to go with Mikey and give (Plumlee) a little more time,'' Malzahn said. ''It was just a gut instinct.''
Keene, who completed 22 of 28 passes, was aided by a UCF defense that ranks No. 1 nationally in red zone defense. The Knights held Memphis scoreless on three trips inside the UCF 10-yard line in the first half.
UCF tight end Alec Holler came up with what Malzahn described as the play of the game in the closing minutes. Holler caught a short screen pass with 2:45 to go on third-and-9 from the UCF 27 and made a determined run to get the first down, somersaulting at the end of play.
Quarterback Seth Henigan passed for 284 yards and a touchdown to lead Memphis, but was intercepted twice. Henigan also led the Tigers with 69 rushing yards and a touchdown.
Harvey capped UCF's opening drive with a 22-yard touchdown run, turning a busted play into a score by reversing field and breaking a tackle before reaching the end zone. He set up another TD with a 61-yard run.
UCF stopped a potential Memphis scoring drive late in the first quarter as nose tackle Anthony Montalvo dropped running back Jevyon Ducker for a one-yard loss on 4th-and-1 from the UCF 6.
The Tigers put together the first scoring drive of the second half to tie the game, 21-all, with Ducker's 1-yard run. Memphis got its final TD with 3:18 left on a Henigan-to-Joe Scates pass covering 14 yards and trimming the UCF lead to seven points.
Memphis coach Ryan Silverfield said he understands that fans are unhappy.
''They should be upset. They have every right to be,'' Silverfield said. ''I appreciate our fan base because they care. I understand that our wonderful fans are loyal and they care and they expect us to compete for championships.''
He urged them ''to continue to hang with us and believe.''
''We'll come out of this all right,'' Silverfield said.
UCF: Playing without Plumlee, the Knights' offense was productive enough behind Keene. Despite being limited to 38 yards in the third quarter, the Knights recovered to score the go-ahead touchdown with 12:19 to go.
Memphis: Entering the game with a three-game losing streak that has placed pressure on Silverfield, the Tigers kept pace with the Knights before faltering. Memphis had been on an 8-1 stretch at home against Top 25 teams, starting with a win over No. 12 Mississippi in 2015.
UCF should remain in the Top 25 with an opportunity to move up the rankings next against a nationally ranked Tulane team that improved to 8-1 Saturday with a win over Tulsa.
A 64-YARD FIELD GOAL ATTEMPT?
Malzahn was as surprised as anyone in Simmons Bank Liberty Stadium when his kicker, Colton Boomer, followed through on an attempted 64-yard field goal try in the closing seconds of the first half. ''The intent was we were going to try and jump offside and take a 5-yard delay (penalty) and punt it,'' Malzahn said. ''But (the center) snapped the ball. That blew my mind. You talk about pushing the panic button . . . that one really aged me.''
UCF travels to No. 19 Tulane on Saturday.
Memphis remains home against Tulsa on Thursday.
More AP college football: https://apnews.com/hub/college-football and https://twitter.com/AP-Top25
Copyright 2023 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.