The Xfinity Series’ Andy’s Frozen Custard 300 at Texas Motor Speedway on Saturday afternoon came down to the final lap between Sam Mayer and Ryan Sieg.

Mayer made a last-lap pass of Sieg. He and Sieg raced hard toward the start-finish line. But it was Mayer who came away with the victory by 0.002 seconds.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Sam Mayer narrowly beats Ryan Sieg

Sam Mayer (#1 JR Motorsports Carolina Carports Chevrolet) edges out Ryan Sieg (#39 RSS Racing Sci Aps Ford) to win the NASCAR Xfinity Series Andy's Frozen Custard 300 on April 13, 2024, at Texas Motor Speedway in Fort Worth, Texas. (Matthew Pearce/Icon Sportswire via Getty Images)

"That’s unreal. I mean, I was like a second and a half back, probably, at one point. So to make up that much time in that little amount of time is certainly unreal," Mayer said. "We led the most important lap. . . . We didn’t dominate by any means, but we certainly worked our tails off to get to that point to win like that."

Sieg sped from 10th to first place in four laps just before the final caution flag of the race. He was leading heading into the final lap of the race, but that was when Mayer caught up to him.

VIEW THE MOMENT ON X.

Sieg got to the inside of Mayer on the final turn but missed out on the victory by a few inches.

NASCAR FINES XFINITY SERIES DRIVER JOEY GASE FOR THROWING BUMPER AT ANOTHER CAR AFTER WRECK

Sam Mayer holds the steer head

Sam Mayer (#1 JR Motorsports Carolina Carports Chevrolet) poses with a longhorn skull after winning the NASCAR Xfinity Series Andy's Frozen Custard 300 on April 13, 2024 at Texas Motor Speedway in Fort Worth, TX. (Chris Leduc/Icon Sportswire via Getty Images)

"The first emotion is definitely disappointment. We had it. We were leading at the end," Sieg said. "We got up front, but we just got too tight. I was doing all I could do. I was changing lines, changing brakes, changing everything. 

"It was just that close. I saw him coming. I was doing all I could do. In the end, I was just trying to run him into the wall to win the race. We were just so close."

Justin Allageir finished in third place with A.J. Allmendinger, Cole Custer, Austin Hill, Ryan Truex, Sammy Smith, Jesse Love and Anthony Alfredo rounded out the top 10.

Sam Mayer at Texas Motor Speedway

Sam Mayer, rear, edges out Ryan Sieg (39) at the finish line to win the NASCAR Xfinity Series auto race in Fort Worth, Texas, Saturday, April 13, 2024. (AP Photo/Larry Papke)

CLICK HERE TO GET THE FOX NEWS APP

Mayer moved to 14th in the standings, while Sieg moved to 11th.

The Associated Press contributed to this report.

Follow Fox News Digital’s sports coverage on X, and subscribe to the Fox News Sports Huddle newsletter.