(Reuters) -Mexican Sergio Perez won a dramatic Azerbaijan Grand Prix for Red Bull on Sunday after a tyre blowout denied championship-leading team mate Max Verstappen certain victory and Lewis Hamilton botched the re-start and failed to score.
The outcome of a rollercoaster afternoon in Baku left the top of the standings unchanged, with Verstappen still four points clear of Mercedes' seven times world champion Hamilton after six races.
The race was red-flagged when Verstappen crashed on the pit straight five laps from the end, the Dutch driver clambering out of the wrecked car and kicking the rear left tyre in fury.
"I didn't feel anything up until the moment that I suddenly went to the right. The tyre just blew off the rim," said Verstappen, who would have gone 15 points clear.
"We were fully in control...we lost out on a lot of points, we could have opened up that gap in the championship as well, so to have this happening so close to the end is very frustrating."
Baku's street circuit then provided another crazy twist at the standing re-start after cars had returned to the pit lane for the track to be cleared.
Hamilton lined up second, with two laps remaining and set to take back the overall lead.
Instead the Briton, his brakes smoking heavily, got it all wrong and his prospective points haul disappeared as he locked up and ran down the escape road in the sprint to the first corner. He finished 15th.
"I'm so sorry, guys," Hamilton said over the radio, his record run of 54 successive races in the points -- excluding the one he missed in Bahrain last year due to a positive COVID-19 test -- at an end.
He referred afterwards to a 'brake magic' switch and explained that he had clipped it unknowingly at the re-start.
Second place dropped instead into the lap of four-times world champion Sebastian Vettel, who had started 11th, in a first podium finish for Aston Martin. Frenchman Pierre Gasly was third for Red Bull-owned AlphaTauri.
The bonus point for fastest lap was not awarded because Verstappen, who set it, did not finish.
"Normally Baku is pretty crazy," said Perez, who had two previous appearances on the podium in Baku with now-defunct Force India. "I have to say sorry to Max, it would have been incredible to get that one-two for the team.
"But at the end, it was a fantastic day for us. We were close to retiring the car but luckily we managed to finish the race," he said.
Perez, now third overall, was ordered to stop the car moments after the chequered flag with the team concerned about an hydraulics issue.
Verstappen watched as his team mate took the top step of the podium for the second time in his career. Perez also won in Bahrain last year with Racing Point.
The race put tyre supplier Pirelli in the spotlight with Vettel's team mate Lance Stroll also crashing out at speed on lap 31 when his car's left rear suddenly went on the main straight.
That crash also triggered the safety car.
Ferrari's Charles Leclerc finished fourth, after starting on pole position for the second race in a row, ahead of McLaren's Lando Norris and Alpine's Fernando Alonso.
AlphaTauri's Japanese rookie Yuki Tsunoda was seventh, his first points since the Bahrain season-opener, with Ferrari's Carlos Sainz eighth and Australian Daniel Ricciardo ninth for McLaren.
Kimi Raikkonen scored the final point for Alfa Romeo.
Hamilton's team mate Valtteri Bottas had a miserable afternoon, never challenging the front runners and ending up 12th. The Finn had won the previous race in Baku in 2019.
Last year's race was cancelled due to COVID-19 and the 2021 edition was held without spectators other than locals watching from balconies.
(Reporting by Alan Baldwin in London, Editing by Hugh Lawson, Clare Fallon and Toby Davis)