A massive crash marred the final laps of the Daytona 500 ... as 23 cars in total pinballed off each other in a wild mess toward the end of the famed race -- although the carnage ultimately allowed underdog William Byron to come out with the win.
The chaos happened with eight laps to go at Daytona International Speedway in Florida ... when Alex Bowman started the wreck by nudging Byron.
The bump caused Byron's No. 24 car to slide into Brad Keselowski's ... which set off a huge chain reaction of accidents.
Check out the replay from the race's broadcast ... more than half of the 40 vehicles in the field got caught up in the melee.
Somehow, Byron escaped it all unscathed ... and after another set of drivers wrecked a few moments after officials got the track all cleaned up, the 26-year-old was declared the winner.
William Byron wins the Daytona 500! #NASCAR pic.twitter.com/bmofJSB6k3
— FOX: NASCAR (@NASCARONFOX) February 20, 2024
Afterward, he celebrated like crazy ... telling reporters he couldn't believe it all was actually happening.
The race, meanwhile, was delayed a full day ... after rain forced NASCAR officials to move it from its usual Sunday start time to Monday.
While Pitbull could not perform his scheduled pre-race concert as planned ... The Rock still made it out to the festivities -- and fired up the crowd when he told the racers to start their engines.
Bubba Wallace finished the race in sixth place ... while fan-favorite Kyle Busch ended up 12th. Jimmie Johnson -- a two-time Daytona 500 winner -- nabbed 28th place after a wreck knocked him out early.