GAINESVILLE, Fla. (AP) — Graham Mertz threw a touchdown pass, Montrell Johnson ran for a score and Florida held on to beat UCF 24-13 on Saturday night.

The Gators (3-2) won consecutive games for the first time in nearly a year and handed the Knights (3-2) a second loss in as many weeks.

UCF dug itself an early hole when coach Gus Malzahn went for it on fourth-and-1 from his own 43 early in the second quarter. Quarterback KJ Jefferson was stopped for no gain, and the Gators took over in plus territory. Florida scored three plays later to take a double-digit lead, 14-3.

Johnson made it 21-3 with a 3-yard leap, and Trey Smack’s short field goal put the Gators up 24-3 at halftime.

UCF played considerably better in the second half and had chances down the stretch, but third-down struggles that included five sacks ended any chance the Knights had of rallying.

Mertz completed 19 of 23 passes for 179 yards, including a 13-yarder to Elijhah Badger for a score. Highly touted freshman DJ Lagway played every third series and completed all four of his throws for 50 yards.

Johnson ran 10 times for 54 yards.

UCF never got its ground game — which ranked first in the Big 12 and second in the nation entering the week — going. RJ Harvey ran 16 times for 75 yards, including a 13-yard touchdown in the fourth.

Jefferson was under pressure much of the night. He completed 12 of 22 passes for 165 yards and an interception. He ran 12 times for minus-18 yards.

The outcome did little to take pressure off Florida coach Billy Napier, who improved to 14-16 in three seasons but has done little to regain the confidence of fans and maybe even his bosses. Napier was flagged for unsportsmanlike conduct for vehemently arguing a running-into-the-kicker penalty.

MISSING KNIGHTS

UCF receiver Xavier Townsend and four teammates are redshirting and planning to enter the transfer portal. The school confirmed their decisions before the game. Defensive end Kaven Call, right tackle Wes Dorsey and safeties Bryon Threats and William Wells joined Townsend in choosing to opt out after UCF’s first four games.

Under NCAA rules, players can play up to four regular-season games without counting toward their four years of eligibility. So all five players can officially enter the transfer portal on Dec. 9 and land elsewhere. They won’t be eligible until 2025.

KEY INJURIES

UCF kicker Colton Boomer didn’t make the trip north because of an undisclosed injury, leaving Grant Reddick to fill in. Reddick made his only field-goal attempt.

Florida played without receivers Tre Wilson and Aidan Mizell. Wilson is recovering from minor knee surgery, and Mizell was seen wearing a protective boot during the team’s bye week.

THE TAKEAWAY

UCF: The Knights consider themselves on the same level as Sunshine State counterparts Florida, Florida State and Miami. But they fell to 1-6 against those in-state foes, with the lone victory coming against the Gators in the 2021 Gasparilla Bowl game that included an interim coach and several opt-outs.

Florida: The Gators played their most complete game of the season to climb above .500 for the first time in nearly 11 months. Defense was the biggest bright spot, allowing 273 yards and finishing with five sacks.

UP NEXT

UCF: Hosts Cincinnati next Saturday.

Florida: Plays at No. 4 Tennessee next Saturday.

___

Get poll alerts and updates on the AP Top 25 throughout the season. Sign up here. AP college football: https://apnews.com/hub/ap-top-25-college-football-poll and https://apnews.com/hub/college-football