MONTREAL -- When misfortune finally struck the Mercedes AMG team, Red Bull's Daniel Ricciardo was there to take the prize.
Ricciardo passed series leader Nico Rosberg with two laps to go and held on for his first Formula One victory in a wild Canadian Grand Prix on Sunday afternoon.
The 24-year-old became the first non-Mercedes driver to win in seven races this season, although even he admitted there was luck involved and that it is too early to say that Red Bull is back as a championship contender.
"Obviously Mercedes had their issues and that enabled us to close on them," a giddy and still disbelieving Ricciardo said after the race. "It's a bit surreal. Really cool."
The Aussie driver remembered to save some champagne from the post-race podium celebration to spray on his race engineer, Toronto native Gavin Ward.
Rosberg finished second despite engine and brake problems, while the second Red Bull driven by four-time world champion and defending Canadian Grand Prix winner Sebastian Vettel came in third.
The race ended under a caution flag after a spectacular crash involving Sergio Perez's Force India car and Felipe Massa's Williams. They narrowly missed taking Vettel out.
Both drivers appeared unhurt as they got out of their cars on their own. They were checked out by track doctors, then had further tests at Sacre-Coeur Hospital and were released.
Race stewards found Perez at fault for the crash and penalized him five grid positions at the next race.
The Red Bull team ruled F1 as Vettel won the last four championships, but a switch to more fuel-efficient turbo engines this year saw Mercedes emerge with what looked like an unbeatable car.
Mercedes AMG won the first six races of the season, with Lewis Hamilton winning four and Rosberg taking two. They had finished one-two in the five previous races.
But the long straights and tight corners of Circuit Gilles-Villeneuve have a history of mishaps, crashes and heartbreak, and this thriller was no exception.
Rosberg kept the lead over Hamilton off the start and both were comfortably in front until just over midway through the 70-lap event.
But then both cars at once developed problems with their Energy Recovery Systems, which convert the energy the car produces into extra power, and that led to rear brakes trouble.
Hamilton, a three-time winner in Canada, exited the race with his brakes emitting smoke after 48 laps. It was a second retirement for Hamilton, who was out of the season-opening Australian GP after two laps with engine trouble.
Rosberg needed all his skill to keep his Mercedes on the track and managed to hang on through the final laps with a line of competitors pushing from behind. But Ricciardo finally got past on the final corner leading to the homestretch of the 4.361-kilometre course.
"I was pleased I was managing to stay ahead with this huge train of cars behind me," said Rosberg. "One guy got by, but I still managed to hang on.
"Losing is disappointing for us as a team. We have such speed and such a great car, to not win and just have one car come in second is hugely disappointing for us. Our ambition is to finish one-two. We have to make sure we get back there next race in Austria."
Ricciardo had spent several laps just trying to get by Perez, whose Mercedes-powered Force India was stronger in the straights, but the Mexican made a braking error and the Aussie shot past on lap 66.
"I needed a bit of a mistake from him," said Ricciardo. "He got close to Nico and perhaps overshot the braking in the last chicane and I managed to just stay with him on the exit.
"Once I had the outside line free, I made it work."
Rosberg earned 18 points to stretch his lead in driver standings over Hamilton to 22 points. Ricciardo, who finished third in the previous two events, moved into third spot, 61 points off the lead.
Vettel earned his second third-place finish of the year, but said the Red Bulls still have a long way to go to catch Mercedes.
"We have a competitive car, but not yet a competitive package to match them and beat them regularly," said the German. "Today we got lucky.
"It feels great and it's a great reward for the whole team after such a painful winter and a difficult start to the season. To get both cars on the podium and beat at least one of the Mercedes, I think that's a very positive day for us."
Rosberg said: "We are fully aware that Red Bull is still an amazingly strong team and pushing like crazy to catch us."
Vettel came within a metre or two of being taken out by Massa, who whizzed across the final chicane straight into a retaining wall.
"I saw something white coming in the mirror and at the last second, I turned right and Felipe was in the air flying past," he said. "I was quite lucky he didn't hit me. I saw him just in time."
Ricciardo spent the last two years with Toro Rossi and moved to Red Bull team when his compatriot Mark Webber retired. He became the fourth Australian to win an F1 race after Jack Brabham, Alan Jones and Webber.
"Very proud," said the Perth, Australia native. "It was great to hear the Aussie anthem. It's been three years since I won a race (in any series). It's a feeling I missed a lot."
The safety car came out during the first lap after a crash that took out both Marussia cars spread debris across the track. Max Chilton looked to lose control and bump Jules Bianchi, who slammed into a wall. Neither was injured.
Esteban Gutierrez was given permission to race, starting from pit lane, despite not taking part in qualifying. The Mexican missed qualifying while having his Sauber chassis changed after a crash in the final practice session on Saturday. He left the race after 64 laps.
The next race is June 22 in Spielberg, Austria at a track, perhaps ominously for Mercedes, called the Red Bull Ring.