Sergio Perez won a rain-affected Singapore Grand Prix leaving his Red Bull teammate Max Verstappen to wait at least another week to retain his Formula One world championship.
The Mexican took the chequered flag 7.5sec ahead of the Ferrari of Charles Leclerc.
However, he had to endure a nervy few hours before his victory was confirmed when he was penalised five seconds for a safety car infringement.
Carlos Sainz was third to make it a double podium for Ferrari in the night race that started more than an hour late because of a storm.
Stream the FORMULA 1 SINGAPORE GRAND PRIX 2022™ LIVE and ad-break free Sunday 11pm AEST on Kayo Sports. New to Kayo? Start your free trial now >
Ricciardo prepares for Singapore heat | 00:48
It was the first grand prix to be held under lights at the Marina Bay Street Circuit since 2019 because of the coronavirus pandemic.
Verstappen had a mathematical chance to clinch a second world title, but needed to win and have other results go his way. He finished seventh after a rollercoaster race.
The Dutchman was always going to struggle after starting eighth on the grid and his task was made trickier by an early evening deluge that delayed the start till 9:05 pm (1305 GMT).
When the field eventually tore away from the grid in a shower of spray, Verstappen almost stalled and dropped back from eighth to 13th.
The 25-year-old cut through the field before flat-spotting his tyres trying to pass Lando Norris for fourth after a safety car restart.
“I was up with Lando and as soon as I braked, the front wheels jumped in the air and I went straight on,” said Verstappen who was forced to pit for fresh rubber and dropped to last place.
“It’s not what I’m here for. Not with a car like that. It was incredibly messy.”
It means his world championship lead over Leclerc has been cut to 104 points ahead of next week’s Japanese Grand Prix. Perez is two points behind Leclerc.
Verstappen will need to be 112 points ahead at the end of next Sunday’s race in Suzuka to retain his title and can do so if he wins and Leclerc fails to finish second.
Leclerc started on pole but Perez slipped past before the first turn and drove a perfect race to hold off the Monegasque for his second GP win of the season.
“It was certainly my best performance,” Perez said.
“I controlled the race. The last three laps were so intense. When I got out of the car, I felt it. I gave everything today.”
Leclerc started on pole but had a sluggish getaway on intermediate tyres in the slippery conditions allowing Perez to reach the first corner in the lead.
“I pushed all the way,” said Leclerc.
“The bad start put us on the back foot and it was a really difficult race after that.”
Sainz started fourth and managed to force his way past Lewis Hamilton on turn one, but he felt he could never threaten the front two and crossed the line 7.7sec behind Leclerc.
“It was very tough out there,” Sainz said. “I never really got into a rhythm in the wet and then couldn’t challenge the top two guys.
“I had to settle for P3, but the good thing is I didn’t do any mistakes and could bring the car home and be quick towards the end of the race.”
The McLaren pair of Norris and Daniel Ricciardo were fourth and fifth, Lance Stroll sixth in the Aston Martin ahead of Verstappen.
“We needed this, and as much as I’m looking forward to Japan I want to enjoy this one,” said Ricciardo.
“I feel with the result, you know, I certainly feel good – it’s been a long time. I think my last top five was probably a year ago in Saudi… so yeah I hadn’t had one this year, which is kind of sad, but we know the year it’s been and I feel like I was certainly due some good fortune.”
Sebastian Vettel, the winner in Singapore the last time the race was run in 2019, was eighth, with Hamilton and the AlphaTauri of Pierre Gasly rounding out the top 10.
Hamilton had been in the battle for pole but had a torrid time, complaining early about his tyres and later slithering into a barrier necessitating a new nose before coming home ninth.
“I think we started off with a really decent weekend, it was really unfortunate at the end,” said Hamilton.
“I was trying, obviously difficult to overtake, that lock up into turn seven, ugh, when those things happen your heart sinks a little bit.”