Red Bull's Sebastian Vettel beat Mercedes' Lewis Hamilton to pole position for the Canadian Grand Prix.
Finnish novice Valtteri Bottas starred in the Williams to take third in damp conditions ahead of Mercedes' Nico Rosberg and Red Bull's Mark Webber.
Vettel's title rivals, Ferrari's Fernando Alonso and Lotus's Kimi Raikkonen, will start sixth and 10th.
McLaren's Jenson Button took 14th and Force India's Paul di Resta 17th.
Vettel, who has never won in Canada, beat Hamilton by just 0.087 seconds but the stand-out performance in difficult conditions was by Bottas.
The 23-year-old was quick throughout qualifying as the conditions changed slightly with varying amounts of rain falling during the session.
Bottas, whose team have failed to score a point this season, was fourth in the first part of qualifying, fourth in the second and a stunning third in final top 10 shoot-out.
"It means a lot," said Bottas. "It has been a difficult first six races for us, so this will be a nice boost for the team. We really got everything right today."
"It was very tricky, especially as you never knew what conditions it would be next time you were out," said Vettel. "We decided to have two runs in the final part and we thought the second one would be quicker especially as we had new tyres, but it started to drizzle again and the track was too wet in the final sector.
"It was very tight with Lewis - in the end everyone was improving in the first two sectors but the last two corners did not allow anyone to go quicker. I didn't mind but it just goes to show how difficult it was for everyone."
Alonso and Raikkonen struggled - the Spaniard was a second slower than Vettel. Raikkonen later received a two-place grid penalty for starting in an incorrect position in the pitlane, along with Toro Rosso's Daniel Ricciardo.
For both of them, their cars' kindness to tyres in dry conditions meant they were less able to generate the immediate tyre temperature they would need to find grip in the damp.
Button was down in 13th place during the second session before a stoppage for a crash at Turn Three by Ferrari's Felipe Massa.
McLaren failed to get him out in time to complete another lap when the session was restarted for a final two minutes and he dropped a further place.
The Englishman said he felt McLaren did not have the pace to be much higher up.
Scot Di Resta joined Lotus's Romain Grosjean in failing to make it out of first qualifying.
Di Resta ended up 17th and Grosjean 19th, despite both fitting new sets of intermediate tyres in the final minutes of the session.
The Frenchman will start from the back on account of a 10-place grid penalty for crashing into the back of Toro Rosso's Daniel Ricciardo at the Monaco Grand Prix.
"It's not even acceptable what happened, wasn't the right settings, had a problem with the gearbox and sat in the garage for four minutes getting that fixed," said Di Resta. "It wasn't that serious a problem. And then when we got out there again it was raining.
"We need to look at what happened because it's not's acceptable and I'm sure the management won't think so either."