Red Bull's Mark Webber beat team-mate Sebastian Vettel to pole position at the Korean Grand Prix.
Webber headed Vettel by 0.074 seconds as McLaren's Lewis Hamilton took third from Ferrari's Fernando Alonso.
Lotus's Kimi Raikkonen was fifth ahead of Ferrari's Felipe Massa, with McLaren's Jenson Button 11th.
Romain Grosjean of Lotus, Force India's Nico Hulkenberg and the Mercedes of Nico Rosberg and Michael Schumacher completed the top 10.
Vettel had appeared set to be on pole, after setting the pace in the first and second parts of qualifying, as well as on the first runs in the top 10 shoot-out.
But the German failed to improve on his final lap and Webber snuck ahead.
Vettel was forced to reduce speed after coming up behind a slow Felipe Massa, who was about to start his quick lap, shortly before the pit entry.
"How did you not tell me about Massa?" he asked his engineer Guillaume Rocquelin on the radio on his slowing down lap.
"What did you expect me to say?" Rocquelin replied.
Vettel said afterwards: "Overall we can be very happy with the result. We were quite happy in the first and second sessions and had a good start to the final session.
"Felipe did nothing wrong, he did his normal out lap. I thought he would come in but he didn't so I had to really slow down two corners before the end of the lap.
"We have had too many discussions of who hindered who [this season]. It was my mistake and I need to do better next time."
Red Bull's advantage was not as big as had been expected from their pace through the weekend.
Webber was just 0.227secs ahead of Hamilton, with the Englishman heading Alonso by only 0.065secs.
Webber said: "Most qualifying sessions have been very tight and I'm very happy to get the job done today. It was a reasonable lap and we did it when it counted. Tomorrow is the main day and I'm in a good position to get a good result."
Hamilton said: "It's going to be very tough to get ahead of them but we have put ourselves in as good a position as I could. We're not that far off. Race pace looked quite good yesterday and I'm just happy to have had a good lap."
McLaren team boss Martin Whitmarsh added: "Mark put in an excellent lap in the end. I'm not sure we expected him to pull that one out. Sebastian, Lewis and Fernando all queued behind Mark will make it quite exciting, I'm sure."
Ferrari team boss Stefano Domenicali said: "We are never pleased because we would like it to be the other way around but if you remember where we were in qualy in terms of gap in [the previous races at] Singapore and Suzuka that means we have made another step in the right direction.
"The target was to start on the second or third row and that has been achieved so we need to have a good race tomorrow. On Friday the race pace was not bad so let's hope to have a clean start."
Alonso has retired at the start in two of the last four races.
Button made a mistake on his first run in second qualifying, locking a front wheel and then could not improve on his final lap because he had to slow for caution flags waved for the broken down Toro Rosso of Daniel Ricciardo.
Australian Ricciardo has since been handed a five-place grid penalty for changing his gearbox.
Mercedes were fined 10,000 Euros for the unsafe release of Michael Schumacher from his pit garage after the German pulled in front of Lewis Hamilton during Q3, forcing the McLaren driver to run off the pitlane and drive around the seven-time world champion.