Daniel Ricciardo took advantage of a tactical masterstroke by his Red Bull team to win in Shanghai after championship leader Sebastian Vettel and Max Verstappen dramatically collided during a thrilling Chinese Grand Prix.

Valtteri Bottas appeared on course to claim his victory after a strategy error by Ferrari allowed the Mercedes car to move ahead of Vettel during their one-and-only round of pit stops.

But the race took a second dramatic twist when the safety car was deployed following a coming together between the Toro Rosso pair of Brendon Hartley and Pierre Gasly on lap 31.

Unlike their rivals, Ricciardo and Verstappen dived into the pits to take on fresh rubber, and the gamble worked for Ricciardo as he passed Kimi Raikkonen, Lewis Hamilton, Vettel and finally Bottas for a quite remarkable win.

But a hot-headed Verstappen, who had been ahead of Ricciardo, blew his chance of victory, when he ran off the road in attempting to make his way past Hamilton and then later collided with Vettel.

The collision at turn 14 saw Vettel cross the line down in eighth, allowing Hamilton, who finished fifth – which then became fourth following a 10-second penalty for Verstappen – to move to within nine points of the furious German.

“I don’t need to say anything here,” Vettel said after his coming together with Verstappen at turn 14.

Indeed the aggressive Dutchman went far too deep on the brakes making a collision inevitable. The stewards concurred slapping the Red Bull man with a timed penalty.

Vettel looked likely to finish seventh, but was overtaken by McLaren’s Fernando Alonso on the penultimate lap to finish even further down the order.

Bottas held off a late surge from Ferrari’s Raikkonen to finish second, albeit nine seconds down on a jubilant Ricciardo.

The third instalment of the championship looked to be heading Vettel’s way after he saw off the rest of the pack to retain the lead on the opening-bend charge.

For the second week in a row, Bottas moved ahead of Raikkonen, while Verstappen fought his way past Hamilton and then Raikkonen, too, to take third.

Hamilton apologised to his team for losing places. Verstappen and the two Mercedes cars were the first of the leaders to pit, but Ferrari left Vettel out on old tyres for two laps too long, and Bottas got the jump on the Ferrari to take the lead.

Ferrari, flummoxed after losing the lead, did not pull Raikkonen in, but rather left him on track in the hope that he could help Vettel get back past Bottas. It did not work.

Bottas had done everything right, but the safety car cost him dearly. Ricciardo however, made no mistake when handed the opportunity with a superb demonstration in overtaking.

“I don’t seem to win boring races,” said Ricciardo after claiming his first victory since last June’s Azerbaijan Grand Prix. “That was unexpected.

“It was hectic. I heard the safety car call a turn 14 and they said we are going to stop. It happened very quickly, but it was a decisive, winning move.

“Sometimes you have just got to lick the stamp and send it. I enjoyed it very much.”