Lewis Hamilton beat title rival Sebastian Vettel to a sensational pole position in a thrillingly chaotic Belgian Grand Prix qualifying in the rain.
A rain shower as the cars began to prepare the first flying laps in the top 10 shoot-out caused havoc but Hamilton came out on top by 0.726 seconds with his final lap.
The Force Indias of Esteban Ocon and Sergio Perez locked out the second row after timing the conditions right - just days after the team were rescued from going out of business.
Red Bull and Ferrari's Kimi Raikkonen lost out in the pits at the key moment.
Hamilton shines when the sun doesn't
Ferrari had looked narrow favourites for pole in the dry but the late rain threw form up in the air and, as so often, Hamilton fared best in the treacherous conditions.
The world champion created anxiety at his Mercedes team with an error, running wide at Fagnes with less than three minutes to go when on a fast lap.
But he put it all together on his crucial final lap to take pole by a very impressive margin.
Vettel heads into the race 24 points adrift of Hamilton and for the sake of his title hopes needs to beat him and take advantage of a weekend when the Ferrari looks the faster car, something he has failed to do in the last two races in Germany and Hungary.
Who will win in Belgium?
Choose your top three drivers from the list below
Fairytale for Force India
In the early moments, the Force Indias stayed out on slicks, hoping to get in a quick lap before conditions worsened too much.
But it is was too wet - and Perez did well to save a huge moment as he lost the car over the brow at Raidillon, part of the famous Eau Rouge section.
The decision to stay out seemed set to cost the team, which went into administration over the last race weekend in Hungary in July but was saved by a consortium of businessmen led by Lawrence Stroll, the father of Williams driver Lance.
But, as the rain eased, both men drove well to take the team's best qualifying position for years.
Some big losers
Red Bull's Max Verstappen was the early pace-setter in the rain, turning the car around quickly while Mercedes and Ferrari took longer to prepare.
But after setting fastest time briefly, Verstappen pitted because he did not have enough fuel to finish the session and dropped down to seventh as others improved at the end.
Raikkonen will also be disappointed. He has been the form man all weekend and pipped Verstappen, only to pit. His demeanour - shaking his head as he stood by the car - betrayed his frustration
Ferrari said he came back in for fresh tyres and a splash of fuel, but they were too marginal on time to go back out.
Behind the Force Indias, Haas' Romain Grosjean starts fifth on the mixed-up grid, with Verstappen's team-mate Daniel Ricciardo and the second Haas of Kevin Magnussen.
Hamilton's team-mate Valtteri Bottas was 10th, not setting a time in Q3, but will start from the back after engine penalties.
Bottas had illustrated the madness of the opening minutes of qualifying with a spin at Blanchimont on his warm-up lap as the rain came down with the drivers on unthreaded slick tyres.
Hamilton also nearly lost his car just afterwards at the Bus Stop chicane, and all piled into the pits for intermediate tyres.
More McLaren woe
In the dry conditions early in qualifying, McLaren were desperately slow.
Fernando Alonso, who is retiring from Formula 1 at the end of the year, was only 17th and team-mate Stoffel Vandoorne slowest of all, the two split by the Williams cars.
What they said
"That was one of the toughest qualifying sessions I can remember," Hamilton said. "It seems to get harder and harder all year. I don't know if they definitely had it. It looked like (the gap was) 0.05secs and I was hopeful I could make it up.
- Predict who will top the podium at Spa
- Who will be rejuvenated by a weekend at Spa?
- All you need to know about F1's return after the summer break
"Then the rain came, I can't even express how difficult it was. I went wide in Turn One, the track looks dry even though it's wet. It was so hard. I went off twice but I am so glad it came together on that last lap."
Vettel said: "I don't think we timed it quite right. I think we had the pace for pole but we will never find out. The gap was quite big so Lewis deserves pole but I think we have good pace for the race so I am confident. We have strong pace so anything can happen.
"I didn't feel I got everything out and it was a bit of a scrappy session. But we saw others not putting enough fuel into until the end so it could have been a lot worse."