Updated

Denny Hamlin came out on top in the 61st running of the Daytona 500 Sunday — not long after a string of dramatic wrecks took out much of the competition in “The Great American Race.”

In all, the race had five crashes and two red flags over the final 20 laps of regulation.

Paul Menard triggered the biggest multi-car wreck shortly after a restart with 10 laps to go.

Another crash soon afterwards involved William Byron, Chase Elliott and Brad Keselowski, among others.

Hamlin raced to his second Daytona 500 victory in four years, holding off Joe Gibbs Racing teammate Kyle Busch.

The race and the season have been dedicated to J.D. Gibbs, Joe Gibbs' eldest son who died last month after battling a degenerative neurological disease. J.D. Gibbs helped his father start the race team, ran it while his father was coaching the Washington Redskins, was a tire changer on the team's first Daytona 500 victory and helped discover Hamlin during a test session at Hickory Motor Speedway in North Carolina. Hamlin's charity had said it would donate $111 to the J.D. Gibbs Legacy Fund for each lap he led.

Denny Hamlin came out on top in the dramatic running of the Daytona 500. (Matt Sullivan/Getty Images, File)

Denny Hamlin came out on top in the dramatic running of the Daytona 500. (Matt Sullivan/Getty Images, File)

He moved out front after a final restart and had Busch blocking in the final lap. Busch finished second, followed by Erik Jones. Defending Cup Series champion Joey Logano was fourth.

Menard turned Matt DiBenedetto, who slammed into the wall and started a chain-reaction crash that collected 21 cars. It brought out a red flag that stopped the race during the cleanup. There were no reports of anybody hurt.

Menard took responsibility for “The Big One” — NASCAR slang describing any crash usually involving five or more cars: “I’ll take the blame for that one.”

ANNETT WINS NASCAR DAYTONA XFINITY RACE

He also said: “It was go time, and I was pushing the 95 [Matt DiBenedetto] and it looked like he was trying to get to the middle and I started trying to get to the outside and just barely hooked him. Yeah, that was my bad. I wrecked a lot of cars. I feel bad about that.”

Jamie McMurray (40), Erik Jones (20), William Byron (24), Brad Keselowski (2), Brendan Gaughan (62), Clint Bowyer (14) and Chase Elliott (9) collide in Turn 3 during the NASCAR Daytona 500 auto race at Daytona International Speedway Sunday in Daytona Beach, Fla. (AP Photo/Phelan M. Ebenhack)

Jamie McMurray (40), Erik Jones (20), William Byron (24), Brad Keselowski (2), Brendan Gaughan (62), Clint Bowyer (14) and Chase Elliott (9) collide in Turn 3 during the NASCAR Daytona 500 auto race at Daytona International Speedway Sunday in Daytona Beach, Fla. (AP Photo/Phelan M. Ebenhack)

Defending Daytona 500 champion Austin Dillon, Chase Elliott, Ryan Blaney, Aric Almirola and Daniel Suarez were among those involved in the mess.

Almirola seemingly had the wildest ride, his back wheels getting lifted off the pavement and landing on David Ragan’s windshield.

CLICK HERE TO GET THE FOX NEWS APP

Hamlin said he would soak up his win, and he said he knows he would have a hangover on Monday: “I’m going to hate tomorrow, but I’m going to love the rest of my life.”

The native of Chesterfield, Virginia, who was sponsored by FedEx Express, was the 2016 Daytona 500 champion; he won what was the closest finish in race history, barely edging Martin Truex Jr.

Fox News' Samuel Chamberlain and The Associated Press contributed to this report.