Nico Rosberg snatched pole position from Lewis Hamilton in a nail-biting battle at the Brazilian Grand Prix.
Briton Hamilton appeared to have turned the tables on his Mercedes team-mate, who had topped every session, when he went fastest with his final lap.
But German Rosberg was still out on track and as he flashed across the line he was faster by just 0.033 seconds.
It means Rosberg wins the new pole position trophy this year for the man who has qualified fastest most often.
It sets up another mouth-watering race on Sunday (16:00 GMT) between the two Mercedes drivers in their tense and season-long title battle.
Rosberg heads into the race 24 points behind Hamilton, who has won 10 races to the German's four this year, with 75 points still available in the remaining races here and in Abu Dhabi in two weeks' time.
The German, who started from pole in the US last weekend only to be beaten by Hamilton in the race, said: "It's only a perfect job if I win. I need to make it happen, unlike in Austin last weekend."
Hamilton said: "It was great fun, Nico did a great lap. I lost bit of time in Turn 10 and perhaps a tiny bit in Turn One. But that's what qualifying should be about - just having to keep going out and finding more time.
|Hamilton v Rosberg 2014 title permutations|
|Hamilton has a 24-point lead over Rosberg with a maximum of 75 points remaining - 25 in Brazil for a win and 50 in Abu Dhabi.|
|The world title cannot be decided at Sunday's Brazilian Grand Prix.|
|If Hamilton wins in Brazil and Rosberg fails to finish, he will have a 49-point lead going to Abu Dhabi. Hamilton would then need to finish 10th or higher to clinch the title.|
|If Rosberg wins in Brazil and Hamilton retires, Rosberg will lead the championship by one point going to Abu Dhabi. Hamilton would then need to finish ahead of Rosberg in the points in Abu Dhabi to secure the title.|
|If Hamilton wins in Brazil, with Rosberg second, Hamilton will arrive in Abu Dhabi with a 31-point lead. But if Rosberg then wins and Hamilton finishes sixth or lower, Rosberg will win the title.|
"It is a long race and it should be quite exciting. I'm here and I want to win. I hope we get to have a race."
Felipe Massa drew huge cheers from the local fans in the packed grandstands around the venue by taking third place, 0.224secs adrift of Rosberg.
The Brazilian's team-mate Valtteri Bottas was fourth ahead of the McLaren of Jenson Button, making it five Mercedes-powered cars in the top five.
Both Williams cars appeared to have a shot at pole - their fastest first and third sector times were each 0.1secs faster than those of Mercedes and their best middle sector time was 0.2secs down on the silver cars.
But both Massa and Bottas made mistakes in the middle sector of their final laps and aborted them.
The margins between Button and the remaining drivers in the top 10 were tiny.
The 2009 world champion, who may well be driving in his penultimate grand prix, was just 0.008secs quicker than Red Bull's Sebastian Vettel.
The second McLaren of Kevin Magnussen, who looks more likely to be retained at McLaren as a partner to their imminent signing Fernando Alonso in 2015, was 0.031secs behind Vettel.
Alonso was just 0.008secs slower than the Dane, 0.098secs quicker than Red Bull's Daniel Ricciardo in ninth and 0.022secs quicker than the second Ferrari of Kimi Raikkonen.
That meant just 0.169secs covered the five cars between the fifth and 10th places.
Raikkonen had appeared to have a slight advantage over Alonso all weekend but when it really mattered he could not beat the Spaniard.
Coverage of the Brazilian Grand Prix is live from 16:00 GMT on BBC Radio 5 live, with text commentary online and highlights on BBC One from 20:30-22:00 GMT.