Max Verstappen was cruising toward an easy second straight victory until an unexpected tyre failure turned the Azerbaijan Grand Prix into a two-lap shootout and a shock victory for Sergio Perez.
The finish in Baku just might have been an unintentional preview of the changes Formula One plans to experiment with later this season in an effort to add excitement to the on-track product.
Championship leader Verstappen crashed out of the lead with four laps remaining to bring out a red flag that set up the unconventional shootout from a standing start.
Lewis Hamilton went off course trying to pass Perez for the lead, marking the first time since 2016 that the top two in the championship standings failed to score points.
That made for an unfamiliar podium as Perez, Sebastian Vettel and Pierre Gasly all finished in the top three for the first time this year.
Australian hope Daniel Ricciardo was ninth is his McLaren as his difficult F1 season continued.
Verstappen had no warning his tyre was about to fail as he slammed into the wall. The Dutchman climbed from his car, inspected the tyre and kicked it in anger before stomping off in disgust over the race-changing failure.
"Sometimes you can hate this sport," Verstappen said after the race.
Red Bull was clearly concerned about the Pirelli tyres after a similar accident ended Lance Stroll's race earlier and under red flag the team asked F1 that the cars be allowed to change tyres before the two-lap sprint to the finish.
F1 had previously announced it would experiment with half-hour sprint races in places of qualifying later this season. Baku was an unexpected preview of an even shorter, more explosive format.
"I was quite happy. It always brings a bit more excitement. It creates some sort of adrenaline inside you," Gasly said of the two-lap sprint that decided the race.
Perez was the leader on the restart but Hamilton shot past him in his attempt to win the race and reclaim the points lead from Verstappen.
But he failed to brake in the first corner and his Mercedes slid off track. Hamilton dropped to 15th, snapping a streak of 54 consecutive races of earning a points position finish.
Hamilton said he accidentally flicked a switch which "basically switches the brakes off and I just went straight".
Four-time champion Vettel took second to give Aston Martin its first ever F1 podium in an an impressive drive after qualifying 11th. It was Vettel's highest finish since 2019. Gasly was third for AlphaTauri.
It was the second career win for Perez, who is in his first season with Red Bull. It somewhat salvaged the race for the team that had been headed toward a 1-2 finish before Verstappen's tyre failed.
Verstappen retained a four-point lead over Hamilton in the standings, while Perez climbed from fifth to third.
"I am so, so happy. First of all I have to say I am very sorry for Max because he had a tremendous race," Perez said.
"We were going to have a 1-2 together, but in the end it was still a fantastic day for us and luckily we were still able to finish the race."
Perez's second win ties him with Pedro Rodriguez for the most in F1 by a Mexican driver.
He called for an investigation into the tyre failures, which should not happen on the straightaway at Baku.
"A failure there is something pretty extreme and luckily nothing happened today, but it's something that has to be reviewed," he said.
Charles Leclerc started on the pole for Ferrari but couldn't replicate his qualifying pace, finishing fourth.
Lando Norris took fifth for McLaren, Fernando Alonso was sixth for Alpine and Gasly's teammate Yuki Tsunoda took a career-best seventh.