CONCORD, N.C. (AP) — Denny Hamlin held off Joe Gibbs Racing teammate Kyle Busch in overtime Sunday night to win the longest — and perhaps wildest — Coca-Cola 600 in history.

Hamlin won for the 48th time in the Cup Series, and for the time in a points race at Charlotte Motor Speedway.

“It is so special,” Hamlin said. “That is the last big one that is not on my resume. We weren’t very good all day but got ourselves in the right place at the right time.”

NASCAR’s longest and grueling race lasted more than 5 1/2 hours and took 413 laps to complete. There were 18 caution flags and 16 drivers failed to finish. The race featured a 12-car wreck and a magnificent crash that sent Chris Buescher’s car flipping over five times before stopping upside down.

Defending race champion Kyle Larson appeared ready to win the race in regulation before Chase Briscoe crashed trying to pass him with two laps to go in regulation.

In the overtime period Larson had the inside lane on the restart in overtime, but Austin Dillon got a push from the second row and soon was running four-wide along with Larson, Hamlin and Ross Chastain.

But a crash ensued involving several cars, including Larson and Dillon.

“I got a little loose and tried to make it stick,” Dillon said. “It didn’t quite work out there. I had to do what I had to do to win the race given where we are in points. We had a shot there to bring home another 600.”

On the next restart Hamlin took the lead and held off Busch for the win. Kevin Harvick finished third and Briscoe was fourth.

“It means so much to me being with the Coke family for 18 years,” Hamlin said. “It worked out perfectly.”

There was a huge wreck came on lap 192 where Ryan Blaney, who won last weekend’s All-Star race, got too low on the apron on the bottom of the track and spun back up the track. That started a chain reaction that caught up 12 cars, sending some of NASCAR’s top stars — Kurt Busch, Brad Keselowski, Bubba Wallace, William Byron and Chase Elliott among them — behind the wall for good.

Elliott led 93 laps before the crash and appeared to be the car to beat.

“It’s chaos out there,” Byron said. “You can’t drive the car the slightest bit sideways or you’re wrecked. So, if somebody gets a little bit sideways, then we all wreck. It either takes out other people or they spin to the infield. Just chaos.”

Said Busch: “I think I hit about 15 different things.”

Blaney said the wreck occurred when he got too low on the apron at the bottom of the track.

“Gosh I hate it,” Blaney said. “Makes you feel pretty dumb for doing that. I hate it tore up our car and a handful of others. … I just didn’t know where I was at and just made a mistake.”

The carnage wasn’t over as Buescher’s No. 17 Ford flipped five times before landing on its roof after a collision on the front stretch with Daniel Suarez. Buescher had to wait until track officials flipped his car back over before he could get out of the car.

He walked away from the crash.

“I guess a tire just ripped off and sent us flipping,” Buescher said. “I have been upside down before, but this was a bit more painful than the Talladega roll.”

Elliott won the first stage, while TrackHouse Racing teammates Daniel Suarez and Ross Chastain won the second and third stages, respectively.

The race also included Tanner Andrews, a tire changer for Joey Logano’s pit crew, getting his right foot clipped by pole sitter Denny Hamlin on pit road.

UP NEXT: The NASCAR Cup Series heads to the St. Louis are next Sunday.

___

More AP auto racing: https://apnews.com/hub/auto-racing and https://twitter.com/AP_Sports