Lewis Hamilton narrowly beat Mercedes team-mate Nico Rosberg to what could be a crucial pole position at the Brazilian Grand Prix.
Hamilton, who must stop Rosberg winning to take the title fight to the final race of the season, was 0.102 seconds quicker in a tense battle.
Rosberg leads the title race by 19 points with a total of 50 available.
Ferrari's Kimi Raikkonen was third, 0.668secs behind Hamilton and ahead of Red Bull's Max Verstappen.
Ferrari's Sebastian Vettel and Red Bull's Daniel Ricciardo completed the top six.
The rain that had threatened throughout the day held off for qualifying, with only occasional light drizzle that did not affect the track.
But heavier and more persistent rain is predicted in Sao Paulo for the race on Sunday, which could bring the Red Bulls and Ferraris into play in the battle between the Mercedes drivers.
Something on your mind, Nico? Which one of these men can win a world title on Sunday?
Hamilton looked on top form throughout qualifying, topping both the first and second sessions and leading by 0.162secs after the first runs in the top 10 shoot-out.
Both men improved on their final runs but Hamilton had just enough to hold off the German.
Hamilton, who has never won in Brazil, said: "I felt quite comfortable in qualifying as I have done all weekend, Nico has been getting quicker and quicker but I have generally had him covered.
"This is the best I could have hoped for coming here, I think it is only my second pole here."
Hamilton said he "did not really mind" if rained, adding: "I am ready for anything."
Hamilton now has two poles in Brazil - same as Brits, Damon Hill and James Hunt (pictured taking it a little easier than perhaps he should have been). Source: Forix
Rosberg said: "It was an exciting qualifying, very close, Lewis was just marginally quicker in the end. My lap was very good as well, but as we have seen this year pole is not always the guy who wins the race."
Mercedes were in a different league from the rest as Raikkonen edged a tight battle for third between the Ferrari and Red Bull drivers with a strong final lap.
The Finn was just 0.081secs quicker than Verstappen, with Vettel a further 0.01secs adrift and Ricciardo 0.045secs behind him.
That's three poles now for Mercedes - same as Renault, here enjoying their first with Jean-Pierre Jabouille in 1980. Source: Forix
Haas driver Romain Grosjean took an impressive seventh, ahead of the Force Indias of Nico Hulkenberg and Sergio Perez, who leap-frogged McLaren's Fernando Alonso with their final laps.
But it was an improved performance from McLaren after a disappointing time in the last three races, with their most competitive-looking performance for some time. Alonso was in the top 10 throughout qualifying.
Alonso's team-mate Jenson Button, likely racing in his penultimate grand prix, was knocked out in first qualifying, in which he was 0.576secs slower than the Spaniard and qualified 17th.
Button complained of "very little front grip", but also of high-speed oversteer, a characteristic with which he has never been comfortable.
Button was knocked out in the first part of qualifying - he wasn't happy
The gulf between the two was illustrated by the fact that Alonso was quick enough on his first lap to not even feel the need to go out again to make sure of his place in second qualifying, for perhaps the first time in McLaren's new Honda era.
Jolyon Palmer put in another impressive performance for Renault, who have announced this week that they are retaining him for 2017.
The Englishman qualified 16th, ahead of team-mate Kevin Magnussen, who was 18th, for the third time in four races.