Navy (4-7, 4-4 American Athletic) possessed the ball for nearly 40 minutes and gained 248 yards, all on the ground. Xavier Arline threw incomplete on the team's only passing attempt.
The loss dropped UCF (8-3, 5-2) out of first place in the AAC and all but eliminated the Knights' chances of playing at home in the conference championship game.
''It's frustrating, but we've got to play football no matter if we're home or away,'' defensive tackle Ricky Barber said. ''Nobody can point fingers. Our plan is to win out at USF, and then no matter where we end up, we've got to put the ball down and play.''
Mikey Keene replaced quarterback John Rhys Plumlee in the second half and immediately led the Knights to their only touchdown of the game.
Keene completed his first three passes for 79 yards, including a 28-yard touchdown pass to Javon Baker. Plumlee then passed to Baker for the 2-point conversion, tying it at 14 early in the third quarter.
John Marshall forced Keene's fumble on the Knights' next possession. It was recovered by Colin Ramos at the UCF 34, and Bijan Nichols' 45-yard field goal lifted Navy to a 17-14 lead with 8:22 left in the third.
After that it was all defense.
''We knew Plumlee was really dynamic with his legs but he was not as capable as a thrower as Mikey Keene was. So we had the mentality that this guy is probably not going to get out of the pocket as much,'' said Marshall, who had four sacks and 10 total tackles. ''Two different ballplayers, but I think we were able to get to both effectively.''
Navy had a 14-6 halftime lead after two long touchdown drives.
The Midshipmen took a 7-0 lead on Arline's quarterback sneak with 8:20 left in the first quarter, completing a 75-yard drive.
''I feel like if we get off to a fast start, we're a hard team to beat, just the nature of our offense and the way our defense is playing,'' Navy coach Ken Niumatalolo said. ''I think that was huge for us to get off to a good start against these guys. We didn't give them any momentum, even though they moved the ball.''
Field goals of 21 and 31 yards by Colton Boomer made it 7-6, but Navy drove 84 yards to another touchdown late in the first half. Vincent Terrell Jr. ran it in from the 8 with 1:33 left.
Plumlee, a senior who had led UCF's ninth-ranked offense for most of the season, completed 11 of 18 passes for 107 yards and threw a long interception on the final play of the half. Keene finished 6 of 10 for 98 yards and a touchdown.
Marshall brought his season sack total to 10 1/2, also a Navy record.
UCF gained 314 total yards, well under its season average of 497.7.
''I think they're spectacular on offense, and the way we were able to put pressure on the quarterback, I think, really affected them later in the game,'' Marshall said. ''Great defensive effort.''
Navy: Three weeks ahead of its 123rd showdown with Army, the Midshipmen gained a huge measure of respect late in a losing season. ... Navy is now 8-1 in games without completing a pass in the Niumatolo era (15 years). ... Navy's previous win, against Temple on Oct. 29, was also accomplished without a completion.
UCF: The loss puts several different scenarios in play for the location of the AAC championship game. It also adds to the importance for the Knights' game at South Florida next weekend.
Navy: Plays against Army at Philadelphia on Dec. 10.
UCF: Plays at USF on Nov. 26.
AP college football: https://apnews.com/hub/college-football and https://twitter.com/ap-top25. Sign up for the AP's college football newsletter: https://tinyurl.com/mrxhe6f2
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.