Oscar Piastri earned his second career victory on Sunday by expertly navigating his McLaren to a dramatic win over Ferrari's Charles Leclerc at the Azerbaijan Grand Prix.
The 23-year-old Australian's victory enabled McLaren to replace Red Bull as leaders of the constructors' championship, ending the champions' two-year dominance, in a race of attrition that ended under a Virtual Safety Car following a spectacular late collision between Carlos Sainz of Ferrari and Red Bull's Sergio Perez as they battled for third.
George Russell finished third for Mercedes ahead of title-chasing Lando Norris in the second McLaren, who fought from 15th on the grid to beat three-time champion and series leader Max Verstappen of Red Bull, who was fifth.
"Well, that was the most stressful afternoon of my life," said Piastri on team radio.
"A big move! Thanks for the car! What a day that was! Thanks, everyone."
Norris, who picked up an extra point for the fastest lap, reduced championship leader Verstappen's lead to 59 points with seven races and three sprints to go.
The race began in warm sunshine under a cloudless sky with temperatures of 27 degrees Celsius (air) and 46 degrees Celsius (track) bathing the 6-kilometer street track.
Hamilton in the other Mercedes and Esteban Ocon (Alpine) both started from the pit-lane following overnight power-unit overhauls and Pierre Gasly (Alpine) from the back of the grid after being excluded from qualifying for a fuel flow infringement.
Leclerc made an excellent start from his fourth Baku pole without a win to pull clear of Piastri while both Red Bulls gained a place and Norris rose to 13th on lap one.
Flurry of pit stops
Hamilton also made early progress. By lap five, he was 15th as Leclerc led Piastri by 0.936 seconds ahead of Perez, Sainz, Verstappen and Russell. Alonso was seventh, four seconds adrift and Norris 11th.
Leclerc increased his pace and established a gap of 3.6 seconds to Piastri. Norris, on hards, was up to ninth and Hamilton 14th, the Britons managing the hot conditions with care.
The pit stops began on lap 12, most switching from mediums for hards. Hamilton dropped to 18th and Norris, without stopping, rose to fifth.
After the flurry of stops, during which Leclerc briefly gifted the lead to Sainz, Piastri stormed into the lead on lap 20, squeezing by on the inside at Turn One.
"They are pushing like crazy - or they have more grip than us," reported Leclerc.
Behind him, a battle royal developed for fifth as Norris resisted Verstappen and Russell behind Albon until he pitted on lap 32. "I have rear grip," grumbled the frustrated Dutchman before Russell swept by on lap 34.
Norris pitted on lap 38 to set up a late charge, passing the champion on lap 48 for sixth.
By then, the leading trio were separated by less than two seconds with Piastri resisting Leclerc's pressure and Perez chasing and it stayed that way, the Australian's superior traction exiting Turn One, keeping him on top as Leclerc's tires deteriorated before Sainz and Perez crashed on lap 50.
Fernando Alonso was sixth for Aston Martin ahead of Williams' Alex Albon and Argentine new boy Franco Colapinto with seven-time champion Hamilton finishing ninth.
Ollie Bearman, standing in for the suspended Kevin Magnussen, was 10th for Haas ahead of his team-mate Nico Hulkenberg. He became the first driver to score points on debut with two different teams.