ELKHART LAKE, Wis. — Sam Mayer moved from Wisconsin to North Carolina as a teenager to pursue his racing dreams more seriously with JR Motorsports.

A return to his home state Saturday ended with the 20-year-old’s first NASCAR Xfinity Series victory.

Mayer pulled ahead for good in the next-to-last lap of a wild second overtime session to win at Road America, about an hour’s drive from his hometown of Franklin, Wisconsin. That elusive first victory came in his 72nd Xfinity start.

“It took coming all the way back here to win one,” Mayer said. “It’s super cool to have that happen, obviously. The fans and everyone in the stands and in victory lane, they were congratulating me non-stop, chanting my name. Stuff like that, you don’t see that very often. And to have that happen today at home, it almost leaves you speechless.”

Mayer won by 0.368 seconds over Parker Kligerman on the sprawling 14-turn, 4.084-mile road course. They were followed in order by Austin Hill, Sage Karam and Riley Herbst.

The race included eight caution flags, tying a track record. The final restart occurred during a second overtime session and followed a red flag to clean up oil on the track.

Justin Allgaier, Mayer’s JR Motorsports teammate, took the lead on the sixth lap of the scheduled 45-lap race and stayed in front through all those restarts.

“He hauled the mail today,” Mayer said. “He was definitely the best car in the field. I think he set the pace for all for us.”

Then everything went haywire on the last one.

Karam passed Allgaier from the right. Mayer then took the lead as those cars briefly went three wide. Karam pulled back ahead soon thereafter. Kligerman then moved in front.

Then Mayer came from the right and passed Kligerman to regain the lead. Mayer stayed in front the rest of the way.

“It was definitely hectic – going back and forth, back and forth,” Mayer said. “Ending on top, thank God.”

The finish was so frantic in part because so many drivers were chasing milestones. Mayer, Karam and Kligerman all were seeking their first career Xfinity victories.

“We’ve been close multiple times,” Kligerman said. “If we keep putting ourselves in position like this, even leading for half a corner, one of these days we’re going to get that checkered flag. Oh, I really, really wanted this one.”

Allgaier spun out soon after getting passed and faded to 18th place.

Other notable drivers in the field also had tough afternoons.

John Hunter Nemechek, who entered the day as the series’ points leader, got knocked out of the race about two-thirds of the way through after he went off course and damaged the nose of his car.

Hill now leads the standings by 14 points over Nemechek.

AJ Allmendinger took the pole position after setting a track record with his average lap speed of 111.666 mph during Friday’s qualifying. He separated from the pack as soon as the race started, but Allgaier passed him around the sixth lap and stayed in the lead until those frantic final moments.

Allmendinger ended up in ninth.

The day instead belonged to Mayer, who had plenty of history on this track after growing up so close to and having so many memories of this place. His father, Scott Mayer, won a Grand-Am race at Road America in 2013.

“It was super-cool to be a part of that and then, obviously, all the way up to now – to be the better Mayer,” Sam Mayer quipped after the race Saturday.

Until that dramatic finish, it seemed this race would be remembered primarily for all the cautions.

Near the race’s halfway point, an apparent brake failure caused Chandler Smith to go off course and crash into the wall.

With about seven laps left, Alex Labbe had an apparent brake issue that caused him to slam into the wall in Turn 1.

Both Smith and Labbe got out of their cars and were examined and released from the care center.