INDIANAPOLIS — In the end, it was Marcus Ericsson.

The Swedish driver emerged victorious to claim the first Indianapolis 500 win of his career.

It didn’t come without some drama. With just a few laps left, Jimmie Johnson, running in his first Indy 500, crashed into Turn 2. That led to the race being red flagged and set the stage for a crucial restart.

Ericsson had a significant lead on the field and looked poised to cruise to victory until Johnson’s crash. On the restart, he held off a fierce challenge from Pato O’Ward to take the checkered flag.

Scott Dixon, the polesitter, ran strong all day, but a late speeding violation in the pits brought his hopes for a second Indy 500 win to an end. Dixon was essentially a spectator during the race’s final laps after a penalty was assessed.

He took little solace in becoming the all-time laps leader in Indianapolis 500 history during the race.

The first caution of the race came out on lap 38 and involved driver Rinus VeeKay, who started in the third position and ran strong during much of the 500.

Flames were visible as his car hit the wall on Turn 2. VeeKay said the car “got loose” and said he was “bummed” for his day to end like that. He walked away uninjured and told reporters he was “fine” after being checked at the medical center.

The second significant crash involved rookie Callum Ilott, who also crashed in Turn 2. The crash brought out the second caution flag of the race and cost Alex Palou dearly. Palou lost position because he needed to make an emergency pitstop to get fuel.

After the restart, fan favorite Conor Daly took the lead before Dixon passed him to retake the lead.

The third caution of the day also involved Turn 2. Rookie Romain Grosjean suffered the same fate as VeeKay and Illott. Grosjean was the fastest rookie in the field and started ninth. The caution flag allowed Dixon and several other drivers to pit.

On the restart, Dixon passed Daly to retake the lead. Santino Ferrucci worked himself into fourth position, only to cede it to Felix Rosenqvist shortly after that.

Colton Herta retired to the pits after 129 laps. His racing team said the car sustained a mechanical issue, bringing an end to his day. Herta said the car “just wasn’t fast enough” and kept getting loose on him, leading to the decision to park it for the rest of the day.

Herta crashed during Friday’s practice on Carb Day. It appeared his team was unable to recover. He’d qualified 25th for Andretti Autosport.

The fourth caution involved Scott McLaughlin. The Team Penske driver crashed on Turn 3 and became the fourth driver of the race retired due to contact. McLaughlin qualified 26th.

He said a gust of wind caught him by surprise, leading to the crash.