Carlos Sainz has won the Singapore Grand Prix for Ferrari to end Formula One leader Max Verstappen's record run of 10 wins in a row and shatter Red Bull's dream of going through the season unbeaten.
McLaren's Lando Norris and Mercedes' Lewis Hamilton completed the top three on Sunday, with Sainz only 0.812 clear at the chequered flag, as Red Bull were swept off the podium for the first time since last November's Brazilian Grand Prix.
In a strategic, slow-burning thriller the Spaniard lived up to his 'smooth operator' nickname.
Starting on pole, Sainz kept the field close enough to remove any pitstop window for others, managing his tyres before helping former teammate Norris stave off the chasing Mercedes by letting him stay in DRS range.
Mercedes' George Russell, pushing hard for the win on far fresher medium tyres than the leaders, crashed on the last lap while in third place with Hamilton inheriting the podium position and also taking fastest lap.
"We nailed the race," said Sainz after his second career win for the Italian team and first since Silverstone last year.
The Spaniard eked out his hard tyres for 42 laps, winning at the slowest possible speed, for Ferrari's first victory since Charles Leclerc triumphed in Austria in July last year.
Red Bull had won 15 successive races until Sunday but that looked set to end from the moment they failed to qualify in the top 10 at a circuit where, like Monaco, overtaking is always a challenge.
Double world champion Verstappen started 11th under the floodlights and finished fifth, with Mexican teammate and closest rival Sergio Perez, last year's winner in Singapore, eighth.
Australia's McLaren rookie Oscar Piastri enjoyed a fine race, gaining 10 places from 17th on the grid to finish among the points in seventh place.
No team has ever won every race in a season of more than 10 rounds but Red Bull had looked capable of doing so until Singapore struck.
Verstappen stretched his overall lead to 151 points but the gap is not big enough for him to secure the title in Japan next weekend.
Hamilton moved up to third overall in the standings for the first time this season, ahead of Aston Martin's Fernando Alonso who failed to score in 15th.
Leclerc finished fourth with Pierre Gasly sixth for Alpine.
New Zealand's Liam Lawson, standing-in for the injured Daniel Ricciardo at AlphaTauri, took his first points in Formula One with ninth place and Kevin Magnussen secured the final one for Haas in 10th.
Mercedes trimmed Red Bull's lead in the constructors' standings to 308 points, keeping them waiting at least another weekend for the title.
The safety car came out on lap 20 when Logan Sargeant's Williams hit the wall and left debris on the track, with the Ferraris pitting but Red Bull staying out.
Verstappen, who started on the hard tyres, moved up to second with Perez fourth but they were soon overhauled and plunged down the field after stopping under normal conditions.
The virtual safety car was also deployed on lap 44 when Alpine's Esteban Ocon stopped with a suspected gearbox failure, with the Mercedes pair pitting as the top three stayed out.
That set up a thrilling final chase with Russell and Hamilton reeling in those ahead but ultimately running out of time and track.