Daniel Ricciardo ended Mercedes' domination of Formula 1 this season by claiming his maiden victory in a thrilling Canadian Grand Prix.
The Red Bull driver jumped the ailing Mercedes of championship leader Nico Rosberg with just two of the 70 laps remaining to claim a surprise win.
Rosberg nevertheless extended his championship lead by finishing second, as team-mate Lewis Hamilton retired with brake failure.
World champion Sebastian Vettel took third as the race finished under the safety car when Sergio Perez (Force India) and Felipe Massa (Williams) collided spectacularly on the approach to Turn 1 on the final lap as they battled for fourth.
That allowed Jenson Button to rise to an unlikely fourth-placed finish, ahead of Nico Hulkenberg's Force India and Fernando Alonso's Ferrari.
The first half of the race played out as most others have done this season, as the two Mercedes drivers engaged in a personal battle for victory.
Rosberg made a slower start than his title rival to Sunday's race, allowing Hamilton to attack him on the run to Turn 1.
But Rosberg defended robustly at the apex, locking a front brake on his Mercedes and forcing Hamilton to run wide on the short approach to Turn 2 and give up second spot to Vettel.
The race was neutralised almost immediately after both Marussias collided at the first chicane.
Max Chilton oversteered wildly into Jules Bianchi through the middle of the corner, pitching the Frenchman into a violent impact with the wall on the outside of the left-hander and putting both cars out of the race.
It took seven laps for the marshals to clear the debris and clean the oil spill from Bianchi's destroyed car, allowing anyone marginal on fuel to breathe easier.
Rosberg built a 1.7-second gap after the restart, before Hamilton was able to use DRS to breeze past Vettel's Red Bull approaching the final chicane on lap 10 of 70.
Hamilton set off after Rosberg and the Mercedes drivers dropped Vettel at a rate of nearly a second lap as another of their personal duels for victory began in earnest.
Rosberg still led by two seconds when he pitted on lap 18. A massive moment on his out-lap through the exit of the first chicane gave Hamilton a sniff of jumping ahead at his own stop on the following lap, but it was six tenths slower than Rosberg's and that - coupled with an unremarkable in-lap from Hamilton - let the German off the hook for his error.
Hamilton re-focused and looked happier on the soft tyres as he set fastest lap and hunted Rosberg down.
The 2008 world champion closed to within half a second and bore down on Rosberg with DRS open when the German straight-lined the final chicane after locking up in the braking zone on lap 25.
Hamilton continued to pile on the pressure, closing back to within a second while the stewards investigated Rosberg's off.
Rosberg was handed a warning, but no penalty, so retained the lead as Hamilton closed in again.
Both Mercedes drivers then reported a sudden loss of power shortly after half distance, and lost roughly two seconds per lap to the chasing pack as they nursed their cars.
They pitted for a second time on consecutive laps, briefly allowing Massa to lead the race, and a slow front-left tyre change for Rosberg allowed Hamilton to get ahead for the first time in the race.
But Hamilton's joy was short-lived. He fell back behind his team-mate on the out-lap after locking up at the hairpin, and then suffered a rear brake lock-up as he tried to re-pass Rosberg at the final chicane.
Hamilton straightlined the corner, and then began a slow tour back to the pits to retire on lap 48 having suffered rear-brake failure.
Rosberg nursed his own brakes to the end, helped by Perez having to fend off the Red Bulls on much older rubber.
Massa used his final set of fresher soft tyres to carve back through the field, passing team-mate Valtteri Bottas and the struggling Force India of Hulkenberg for fifth in the closing stages and then hunting down the leading quartet.
Ricciardo jumped the ailing Perez (also suffering brake and electrical problems) with just five laps to run and tore off after Rosberg, passing him for the lead with only three laps left by using DRS on the back straight.
When the safety car was deployed for the second time after Perez - who used an alternative one-stop strategy to rise from 13th on the grid to the podium fight - and Massa collided, Ricciardo's first win in Formula 1 was assured.
Bottas nursed his own Williams to seventh, battling brake and ERS problems of his own, while the Toro Rosso of Jean-Eric Vergne, Kevin Magnussen's McLaren, and the Ferrari of Kimi Raikkonen - who recovered from a spin at the hairpin - rounded out the scorers.
Results - 70 laps
Pos Driver Team Time/Gap
1. Daniel Ricciardo Red Bull-Renault 1h39m12.830s
2. Nico Rosberg Mercedes +4.236s
3. Sebastian Vettel Red Bull-Renault +5.247s
4. Jenson Button McLaren-Mercedes +11.755s
5. Nico Hulkenberg Force India-Mercedes +12.843s
6. Fernando Alonso Ferrari +14.869s
7. Valtteri Bottas Williams-Mercedes +23.578s
8. Jean-Eric Vergne Toro Rosso-Renault +28.026s
9. Kevin Magnussen McLaren-Mercedes +29.254s
10. Kimi Raikkonen Ferrari +53.678s
11. Sergio Perez Force India-Mercedes -1 lap
12. Felipe Massa Williams-Mercedes -1 lap
13. Adrian Sutil Sauber-Ferrari -1 lap
14. Esteban Gutierrez Sauber-Ferrari -6 laps
Romain Grosjean Lotus-Renault 58 laps
Daniil Kvyat Toro Rosso-Renault 47 laps
Lewis Hamilton Mercedes 45 laps
Kamui Kobayashi Caterham-Renault 22 laps
Pastor Maldonado Lotus-Renault 21 laps
Marcus Ericsson Caterham-Renault 6 laps
Max Chilton Marussia-Ferrari 0 laps
Jules Bianchi Marussia-Ferrari 0 laps
Drivers' championship Constructors' championship
1. Nico Rosberg 140 1. Mercedes 258
2. Lewis Hamilton 118 2. Red Bull-Renault 139
3. Daniel Ricciardo 79 3. Ferrari 87
4. Fernando Alonso 69 4. Force India-Mercedes 77
5. Sebastian Vettel 60 5. McLaren-Mercedes 66
6. Nico Hulkenberg 57 6. Williams-Mercedes 58
7. Jenson Button 43 7. Toro Rosso-Renault 12
8. Valtteri Bottas 40 8. Lotus-Renault 8
9. Kevin Magnussen 23 9. Marussia-Ferrari 2
10. Sergio Perez 20 10. Sauber-Ferrari 0
11. Felipe Massa 18 11. Caterham-Renault 0