Perez hasn't got a seat in F1 for the 2021 season
Racing Point's Sergio Perez took his first Formula 1 victory in the Sakhir Grand Prix as Mercedes fumbled what should have been a debut win for George Russell.
The 22-year-old Briton, standing in for Lewis Hamilton after the world champion contracted coronavirus, was on his way to an accomplished victory before a late-race safety car.
Mercedes did not have to pit their cars, but chose to do so in what was intended to be a safety decision.
But they put the wrong tyres on Russell's car and in the confusion could not find the right tyres for his team-mate Valtteri Bottas, who had to have his old tyres fitted back on to his car.
Russell had to stop again the next time around to fit a correct set, and the Mercedes were now down in fourth and fifth places, Bottas ahead.
Russell could still have won the race, but a puncture when he was trying to chase down Perez sent him to the back. He carved his way back up to ninth for his first F1 points, but that will be scant reward after such drama.
It was a remarkable drive by Perez, who had to pit at the end of the first lap after being hit by Ferrari's Charles Leclerc at Turn Four.
But the Mexican, who does not yet have a seat next season, drove a superb race, carving up through the field and was set for a brilliant third place before Mercedes hit trouble.
Renault's Esteban Ocon took second for his first F1 podium finish, with Lance Stroll joining Racing Point team-mate Perez on the podium.
A terrible twist for Russell
It was an agonising day for Russell, who has impressed enormously on his debut for Mercedes.
Russell missed out on pole position by just 0.026 seconds but took the lead at the first corner after making a better start than Bottas.
Russell controlled the race from there and was on course for a comfortable victory before Mercedes fumbled what should have been another one-two finish.
Russell led through what was intended to be Mercedes' only pit stop and was five seconds clear of Bottas when Jack Aitken - only racing because of Russell's temporary switch to Mercedes - spun his Williams at the last corner and took off its front wing against the barrier and the safety car was deployed.
Mercedes chose to bring the cars in together, with the intention of fitting new medium tyres so they were not vulnerable at the re-start.
But a radio communications problem meant a mixed set of tyres was fitted to Russell's car - he had Bottas' fronts and his own rears - and he had to come in again the next time around to rectify the mistake.
Bottas was stacked behind Russell in the pits. As soon as Russell exited, the team realised he had two of Bottas' tyres on his car and would need to stop again. There was a brief moment of confusion while the mechanics wondered what to do, before the team decided to re-fit the previous set to his car.
The race stewards investigated Russell being sent out on track with his team-mate's tyres on his car, but the driver escaped sanction and keeps his first world championship points.
Mercedes, however, were fined 20,000 euros for incident. Mitigating circumstances were given as the reason for not issuing a sporting penalty, as well as lack of specific rule dealing with it.
When the race re-started, Russell quickly passed Bottas after the Finn made a mistake and ran wide at Turn Four, Russell getting alongside through Five and Six and passing into the chicane.
He then picked off Stroll and Ocon and was trying to erase Perez's lead when he was told he had a left rear puncture.
"I don't know what to say," he said on the radio. His engineer said he shared his feelings.
Bottas was struggling on his used tyres and actually lost places to slower cars behind on fresher tyres, slipping back to eighth at the finish, only one place ahead of Russell.
He was passed by McLaren's Carlos Sainz, who took fourth, Renault's Daniel Ricciardo and Red Bull's Alex Albon, whose seat Perez is hoping to be given in 2021.
What a drive from Perez
The incident at the first corner dropped Perez down to 18th
Perez, contesting his 190th F1 race, looked to be out of contention after Leclerc locked up in an ambitious move down his inside on the first lap, an incident that also took out Red Bull's Max Verstappen, who avoided the collision but then crashed on his own after going into the gravel trap.
Leclerc has been given a three-place grid penalty in Abu Dhabi this weekend for the error.
Perez drove a remarkable race to carve back up through the field, not pitting again until lap 48, by which time he was up to third place.
That put him back down to ninth place, but again he set about the cars in front, passing Stroll and Ocon, as well as benefiting as strategies played out in front of him, and was back up to third when the safety car came out.
"I am a little bit speechless," said Perez. "I hope I am not dreaming because I dream so many years being in this moment - 10 years it took me, I don't know what to say. Incredible; after the start I thought the race was again gone but it was all about not giving up and recovering.
"The luck has not been with us this year but we won the race on merit. Yes, the Mercedes had some issues but we had the pace to hold George."
-- Courtesy of BBC Sport