JACKSONVILLE, Fla. (AP) It likely was Lamar Jackson's farewell performance.

It definitely was Keytaon Thompson's coming-out party.

Thompson, a highly touted freshman making his first start in place of injured quarterback Nick Fitzgerald, ran for 147 yards and three touchdowns to help No. 24 Mississippi State beat Jackson and Louisville 31-27 in the TaxSlayer Bowl on Saturday.

''He was phenomenal,'' Bulldogs interim coach Greg Knox said.

Thompson completed 11 of 20 passes for 127 yards, with an interception. He was more effective as a runner, carrying on 27 of the team's 55 running plays.

''We knew that's what he did best,'' Knox said. ''If you go back and look at Mississippi State over the year, when Nick Fitzgerald ran the ball for a hundred yards, we were winning games. So we knew he had to run the ball today.

''We didn't care if he was a freshman. We didn't care if he was starting his first game. We knew we could scheme some things up for him to run the ball, and he could have success.''

Thompson scored twice in the fourth quarter, including a 1-yard plunge with 3:39 remaining that put the Bulldogs (9-4) ahead for good.

Jackson had the Cardinals (8-5) on the move late, but safety Mark McLaurin intercepted his third pass of the game. Jackson got another chance in the waning seconds following a failed, fourth-down conversation. But his desperation heave was batted away in the end zone.

That set off a wild and tearful celebration for Mississippi State, which stuck together despite losing coach Dan Mullen and a number of assistants to Florida. Knox got doused on the sideline. Players ripped off jerseys in 50-degree temperatures and danced in the end zone.

''The last three, four weeks we've been together, it's been a tough time for everyone,'' Knox said. ''A lot of emotions. ... I think that's what you saw on the field. It was a chance for everyone to just breathe a sigh of relief and say, `Thank you God for this win.'''

Jackson, the 2016 Heisman Trophy winner, had different emotions after probably ending his college career with a loss. Jackson has yet to declare for the NFL draft, but most outsiders believe the dynamic junior will turn pro.

''I got to sit down with my coach and my family,'' he said.

If he is leaving, he went out setting records.

Jackson ran 24 times for 158 yards and a touchdown, breaking the TaxSlayer Bowl record for most rushing yards by a quarterback. West Virginia's Pat White set the previous mark with 145 yards in 2007. He also broke his own school records for rushing yards and yards from scrimmage.

He had the longest run of his career, a 75-yarder late in the second quarter, and a 13-yard TD scamper earlier in the game in which he split two defenders and made another look silly . He also had a flip pass to Jaylen Smith for a score.

But his interceptions overshadowed his improvisations.

Jackson completed 13 of 31 passes for 171 yards, with two touchdowns, four picks and six sacks. He threw just six interceptions in the regular season.

Still, he became the third player in Football Bowl Subdivision history with at least 50 touchdown passes and 50 touchdown runs, joining Florida's Tim Tebow and Nevada's Colin Kaepernick.

''I'd love to see him come back, there's no question about that,'' Louisville coach Bobby Petrino said. ''He really needs to understand where his draft status is, what the finances are that go with that. Him and his mom, we'll get people around him to help him make the decision.

''But they just need to make an educated business decision.''

TAKEAWAY

Louisville: Jackson has to become a more accurate passer to make it in the NFL. He had way too many errant throws, including on two of his interceptions.

Mississippi State: New coach Joe Moorhead will have a chance to win games early thanks to what Mullen built in Starkville.

RARE FEAT

It was the fourth time in the FBC this season that both starting quarterbacks topped 100 yards rushing.

UP NEXT

Louisville: Freshman Jawon Pass is the obvious choice to replace Jackson. If so, he will be thrown into the fire right away because the Cardinals open next season against perennial power Alabama in Orlando on Sept. 1.

Mississippi State: Moorhead inherits an experienced defense and an offense expected to return a number of starters, including Fitzgerald and running back Aeris Williams. The Bulldogs open next season against Stephen F. Austin on Sept. 1.

---

More AP college football: www.collegefootball.ap.org and https://twitter.com/AP-Top25

Copyright 2017 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.