DAYTONA BEACH, Fla. — In a single thrilling lap around NASCAR's most storied track, Denny Hamlin and Ryan Newman displayed the risks and rewards of the dangerous sport they both love.

Hamlin won his second consecutive Daytona 500 and third in five years on Monday night as he surged past Newman on the final lap of a second overtime shootout. The win came as Newman's car was turned hard into the wall, then flipped onto its roof, where he was helpless as he was hit in the driver's side by another car.

His car continued to skid upside down along the speedway and it crossed the finish line in flames as safety crews hurried to snuff out the fire and pry Newman loose. It took several minutes for his car to be rolled back onto its wheels, and medical personnel used solid black barriers to block the view as the 2008 Daytona 500 winner was placed in a waiting ambulance and taken to a hospital.

All the while, a sense of dread settled over Daytona and its showcase race, already pushed back a day by rain that dampened a raucous visit by President Donald Trump. There has not been a fatality in NASCAR's elite Cup Series since 2001, but Newman's crash had everyone worried.

The damage to his Mustang was extensive — it appeared the entire roll cage designed to protect his head had caved — and officials would not allow his team near the accident site. Two agonizing hours after the crash, NASCAR read a statement from Roush Fenway Racing that said Newman was in “serious condition, but doctors have indicated his injuries are not life threatening.”

Hamlin, meanwhile, was trying to find the delicate balance of celebrating a milestone victory while showing proper respect to an injured driver. Initially unaware of Newman's situation, Hamlin did victory burnouts and celebrated with his team.

Not until Fox Sports said it would not interview him did Hamlin learn the severity of the situation. Team owner Joe Gibbs was apologetic for the No. 11 team's initial reaction.

“I was focusing on our car, and everybody started celebrating around us,” Gibbs said. “So I say to everybody out there, some people may have saw us and said, 'Well, these guys are celebrating when there's a serious issue going on.' I apologize to everybody, but we really didn't know.”

The crash was a stark reminder of both the dangers of auto racing and the improvements NASCAR has made since 2001, when Dale Earnhardt was killed on the final lap of the Daytona 500. Earnhardt was the last Cup driver killed in a race and NASCAR has made massive safety improvements in the nearly 20 years since.

“I think we take for granted sometimes how safe the cars are,” Hamlin said. “But number one, we are praying for Ryan.”

During the long wait for an update, Trump took to Twitter to express his concern. A day earlier, he attended the race as the grand marshal, gave the command for drivers to start their engines and made a ceremonial pace lap around Daytona International Speedway before rain washed out the race.

“Praying for Ryan Newman, a great and brave @NASCAR driver! #PrayingForRyan,” Trump tweeted. Newman was one of several NASCAR drivers who attended a 2016 rally for then-candidate Trump in Georgia.

Mark Rushbrook, global director of Ford Performance Motorsports, acknowledged the delay for information on Newman.

“To hear some positive news tonight is a relief,” Rushbrook said. “He is so respected for being a great competitor by everyone in the sport.”

Newman had taken the lead on the final lap when Ryan Blaney’s bumper caught the back of his Ford and sent Newman hard right into the wall. His car flipped, rolled, was hit on the driver’s side by another car, and finally skidded across the finish line in flames.

Drivers were stricken with concern, including Hamlin, the first driver since Sterling Marlin in 1995 to win consecutive Daytona 500's.

“It's a weird balance of excitement and happiness for yourself, but someone's health and their family is bigger than any win in any sport," he said. "We are just hoping for the best.”

Runner-up Blaney said he got a push from Hamlin that locked him in behind Newman in a move of brand alliance for Ford.

“We pushed Newman there to the lead and then we got a push from the 11 ... I was committed to just pushing him to the win and having a Ford win it and got the bumpers hooked up wrong,” he said.

Hamlin had eight Ford drivers lined up behind him as the leader on the second overtime shootout without a single fellow Toyota driver in the vicinity to help him. It allowed Newman to get past him for the lead, but the bumping in the pack led to Newman's hard turn into the wall.

Hamlin’s win last year was a 1-2-3 sweep for Joe Gibbs Racing and kicked off a yearlong company celebration in which Gibbs drivers won a record 19 races and the Cup championship. Now his third Daytona 500 win puts him alongside six Hall of Fame drivers as winners of three or more Daytona 500s. He tied Dale Jarrett — who gave JGR its first Daytona 500 win in 1993 — Jeff Gordon and Bobby Allison. Hamlin trails Cale Yarborough’s four wins and the record seven by Richard Petty.

This victory came after just the second rain postponement in 62 years, a pair of red flag stoppages and two overtimes. The 0.014 margin of victory was the second closest in race history, trailing only Hamlin’s win over Martin Truex Jr. in 2016 (0.01 seconds)

The win in “The Great American Race” is the third for Toyota, all won by Hamlin. Gibbs has four Daytona 500 victories as an owner.

___

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