JACKSONVILLE, Fla. — Tyler Buchner accounted for five touchdowns to help offset two interceptions returned for TDs, and No. 21 Notre Dame beat No. 19 South Carolina 45-38 in a wild TaxSlayer Bowl on Friday.

The highest-scoring game in Gator Bowl history was filled with big plays and memorable moments. But Buchner delivered the knockout blow when he found tight end Mitchell Evans wide open for a 16-yard touchdown on a third-and-7 play with 1:38 remaining.

“The game we played was great. We won the game, and I couldn’t be happier,” Buchner said. “But for me, personally, I didn’t play to the standard I wanted to play. I think I accounted for two extra touchdowns they didn’t want me to account for. That’s not the standard I hold myself to.”

Buchner, who regained the starting job after Drew Pyne entered the transfer portal following the regular-season finale, threw for 274 yards and three touchdowns. He also ran for 61 yards and two scores.

But his three interceptions nearly proved too much to overcome.

O’Donnell Fortune returned one of them 100 yards for a touchdown in the fourth quarter and DQ Smith returned another 47 yards for a score in the first. But Buchner bounced back from both miscues to earn his first victory in three career starts.

“He’s special,” Notre Dame coach Marcus Freeman said.

Notre Dame (9-4) overcame a 14-point deficit and won despite South Carolina’s scoring on the two pick-sixes and on special teams. Punter Kai Kroger connected with long-snapper Hunter Rogers for one of the oddest TDs in bowl lore.

Spencer Rattler completed 29 of 44 passes for 246 yards for the Gamecocks (8-5), with an interception and two touchdowns to Xavier Legette.

South Carolina was missing a number of key starters, including running back MarShawn Lloyd, versatile tight end Jaheim Bell, tight end Austin Stogner, defensive lineman Zacch Pickens, safety Devonni Reed, cornerbacks Cam Smith and Darius Rush and receivers Josh Vann and Jalen Brooks.

“For us to be down that many players and for those guys to play their butts off like they did and leave everything out there like they did, I’m really really, really proud to be their coach,” Gamecocks coach Shane Beamer said. “In that locker room there’s a hurtin’ group of guys that left it all out there.”

Notre Dame played without All-American tight end Michael Mayer, standout edge rusher Isaiah Foskey, cornerback Cam Hart and defensive lineman Jayson Ademilola.

“This is what real life is about: the ability to respond to situations,” Freeman said.

The Associated Press contributed to this story.