Red Bull's Sebastian Vettel snatched pole position from team-mate Mark Webber with the last lap of qualifying at the United States Grand Prix.
Lotus's Romain Grosjean took third ahead of Sauber's Nico Hulkenberg and Mercedes' Lewis Hamilton.
Ferrari's Fernando Alonso sealed his best grid position for four races with sixth ahead of McLaren's Sergio Perez.
McLaren's Jenson Button was 13th and will drop to 14th after a penalty for ignoring red flags in Friday practice.
Williams's Valtteri Bottas was an excellent ninth, a career-best performance in the dry in his rookie season, with Sauber's Esteban Gutierrez in 10th.
Mexican Gutierrez was later given a 10-place grid penalty for impeding Williams's Pastor Maldonado during the first session. Gutierrez will now start 20th and Maldonado 17th.
Mercedes driver Nico Rosberg was eliminated in the second knock-out session, in which he was 14th fastest.
He will move up a spot as a result of Button's penalty.
Webber looked to have a shot at beating Vettel to pole for the second consecutive race after setting the pace with his first set of tyres at the start of the final session of qualifying.
But Webber set his time first on their second runs at the end of the session and with a target to aim at Vettel edged him out by 0.103secs.
The German, who won the world championship in India two races ago, can set a new record of eight consecutive wins in a single season on Sunday.
"I'm looking forward to tomorrow," said Vettel. "If you have the chance to win you want to go for it. Everything came together today and we'll see how it goes."
"Sometimes you're happy you've done your best and sometimes you're not," Webber said.
"Seb put all his sectors together. I put two and a half together and just dropped it in the last sector. That's the way it goes sometimes."
The Australian made a mistake in the tricky Turn 19 and ran wide.
"The apex is a little blind so it's easy to get it wrong," Webber said. "I was in that club."
Grosjean was a massive 0.817secs behind Vettel and beat Hulkenberg by 0.141secs, with Hamilton missing out on a place on the second row by just 0.049secs.
Alonso's performance was better than Ferrari expected heading into qualifying after a difficult run through the practice sessions, when the team were struggling to get into the top 10.
Rosberg complained of poor balance and was just over 0.5secs slower than Hamilton in second qualifying.
Track conditions had changed from morning to afternoon, with a more gusty wind, and Rosberg was one of those drivers who appeared to struggle with the difference that made to the handling of the cars.