BAKU, Azerbaijan — Lewis Hamilton celebrated one of the luckiest wins of his career on Sunday after a crash-strewn and chaotic Azerbaijan Grand Prix that catapulted him into the lead of the Formula One world championship.
The surprise victory, after teammate Valtteri Bottas suffered a puncture with three laps left while leading, ended a six-race drought for the four-time champion dating back to last October.
It was the first victory of the season for champion Mercedes.
In a race where the safety car again played a major part, with a series of crashes and smashes, Kimi Raikkonen finished second for Ferrari while Mexican Sergio Perez was third for Force India.
Ferrari's Sebastian Vettel, who had led the championship before Baku and looked to be on course for a 50th career win and third out of four this season, started on pole position but finished fourth.
Hamilton now has 70 points to Vettel's 66.
Red Bull's Australian Daniel Ricciardo, last year's winner in Baku and also in China two weekends ago, smashed into the back of teammate Max Verstappen in a lap 40 collision that ended the race for both of them.
"It was quite an emotional race. Valtteri did an exceptional job and deserved to win, Sebastian also did a great job so it feels a bit odd to be up here," Hamilton said on the podium.
"Definitely an untidy race for me."
The Briton had started on the front row for the first time since he took pole in the Australian season-opener but never looked like winning until luck removed both Vettel and Bottas from the equation.
"It was such a crazy race, such an exciting race ... to come out with a win, I feel incredibly grateful," said Hamilton, who went to commiserate with Bottas afterwards.
Spaniard Carlos Sainz was fifth for Renault with Monegasque rookie Charles Leclerc sixth for Sauber, his first points in Formula One.
"It felt like a win, I'm on a cloud now, it has been an amazing race," said Leclerc.
New Zealander Brendon Hartley was also celebrating his first point after taking 10th for Toro Rosso.
McLaren, who had its worst qualifying of the season on Saturday, ended up with a double-points finish -- Fernando Alonso seventh and Stoffel Vandoorne ninth.
Canadian teenager Lance Stroll, third in Baku last year, finished eighth to give struggling former champions Williams their first points of the year. Only 13 cars finished the race.
While Vettel made a clean getaway, there was immediate carnage behind, and the safety car was swiftly deployed. Raikkonen and Force India's Esteban Ocon collided, ending the Frenchman's race and sending a shower of debris across the track.
Williams's Russian rookie Sergey Sirotkin ran into the back of Perez, who nudged Renault's Nico Hulkenberg into Alonso — the Spaniard limping back to the pits on two tires and rims.
Hulkenberg then hit the wall on lap 11 while in fifth place, retiring, after he and Sainz had battled the Red Bulls.
Ricciardo and Verstappen could have collided several times before they eventually did, Ricciardo running into Verstappen while trying to pass at the first corner.
Retired triple world champion Niki Lauda told reporters the blame lay 70 percent with Verstappen, whose season has been full of collisions, but Red Bull principal Christian Horner said they shared it equally.
"They are both in the doghouse. They will apologise to all of the staff before Barcelona," he said. Stewards later reprimanded both drivers.
The ensuing safety car played into Bottas's hands as the Finn had yet to pit. While it was out, with marshals cleaning up debris, Romain Grosjean crashed his Haas while warming his tires. That kept the safety car out for even longer, and when racing resumed Vettel passed Bottas but then ran wide as Hamilton and Raikkonen swept through.
As Bottas headed for victory, he ran over a piece of debris that had been left behind and the race took yet another unexpected twist.
"I'm absolutely heartbroken. It hurts a lot. But this is racing; some days are good, some days are bad — and some days are very bad. A small piece of debris destroyed my entire weekend," he said.
Reporting by Alan Baldwin