Championship leader Jenson Button put himself on pole position for a fourth win in five races on Saturday after a last-gasp duel with Red Bull's Sebastian Vettel at the Spanish Grand Prix.
The driver starting on pole in Barcelona has gone on to win in the past eight years and 13 times in the past 14.
It could easily have been Vettel as Button left the pits late and blasted across the finish line to start his final timed lap a mere 1.6 seconds before the session ended.
"It could have gone very, very wrong...I think I just got across the line with a couple of seconds to spare, more luck than judgement," Button said. "It's a little bit of a surprise to be on pole."
Germany's Vettel, the only other driver to have won this season, will have a heavier car but several laps more fuel for the first stint than Button. The published weights showed the Red Bull at 651.5kg compared to Button's 646.0.
"I would have wished to have the pole but at the last minute he took it away," said Vettel.
Button's team mate Rubens Barrichello qualified third, with Felipe Massa alongside on an all-Brazilian second row for revived champions Ferrari. Massa's car was the heaviest of the top four, weighing in at 655 kg with Barrichello on 649.5.
Button, who has a 12-point lead over Barrichello, won from pole in Australia and Malaysia but had not qualified in the top three for the past two races. Saturday's was the sixth pole of his career.
Australian Mark Webber was fifth for Red Bull, Mercedes-powered Brawn's closest rivals, just ahead of the Toyotas of Timo Glock and Jarno Trulli.
Spain's double world champion Fernando Alonso will start eighth for Renault in a disappointment for the locals, who have turned out in smaller numbers so far this weekend in a reflection of his reduced pulling power.
Alonso's car was also shown to be the lighest on the grid.
Massa showed that Ferrari's aerodynamic upgrade had put them a step closer to the leaders and he will also get a boost at the start from the KERS energy recovery system that the cars ahead of him do not have.
Button was worried that this could cause problems.
"When one car is coming at the first corner a lot quicker than the others in front of him, it could cause mayhem," he said. "Especially with quite a high-speed corner like this one."
Massa's team mate Kimi Raikkonen, the 2007 world champion who won in Barcelona last year, qualified 16th only after an error shared by team and driver.
Thinking that he had done a quick enough time to get through to the second stage (Q2) of qualifying, the Finn passed up the chance to do one more flying lap. He was wrong, others went faster and he was eliminated.
"We made a stupid mistake...we thought my best time would be enough to make it to Q2 and so I stayed in the garage. There's no point in saying whose fault it was, because we can't do anything about it now," said Raikkonen.
McLaren also had a dismal day with Britain's world champion Lewis Hamilton 14th, his worst performance to date in dry conditions, and team mate Heikki Kovalainen 18th.