Jenson Button starts from pole position for the third time this year after a stunning last-gasp lap at the Circuit de Catalunya.
Button bumped title rival Sebastian Vettel back to second place having begun his final effort with only two seconds to spare.
Meanwhile it was another qualifying disaster for Ferrari as Kimi Raikkonen was knocked out in the first segment and starts 16th.
Several top drivers began Q1 trying to get quick times out of the hard tyres. But even the Brawn drivers found them too slow.
Others, like Felipe Massa, elected to run the soft tyre from the start and he went quickest of all to begin with, carrying on his form from practice with a 1’20.484.
McLaren were visibly struggling, Heikki Kovalainen seemingly rooted to the bottom five despite several attempts on soft tyres. Stuck in 18th on 1’22.093, he improved to a 1’21.675, leaving him a vulnerable 14th.
Felipe Massa and second-placed Sebastian Vettel stayed in the pits during the final flurry of laps. So did Kimi Raikkonen, but he was eight tenths slower than his team mate.
That proved a fatal mistake by Ferrari – just as it had been for Massa at Malaysia. Raikkonen was knocked back by a series of improving rivals and fell to 16th – and out of qualifying.
Drivers eliminated in Q1
16. Kimi Raikkonen, Ferrari, 1’21.291
17. Sebastien Bourdais, Toro Rosso-Ferrari, 1’21.300
18. Heikki Kovalainen, McLaren-Mercedes, 1’21.675
19. Adrian Sutil, Force India-Mercedes, 1’21.742
20. Giancarlo Fisichella, Force India-Mercedes, 1’22.204
Sebastien Buemi made the early running but a mistake at Campsa saw him bump across the gravel trap and make light contact with the barrier.
The Red Bulls, meanwhile, were flying. Mark Webber set a 1’20.007 and Vettel lined up behind him on a 1’20.220. The German might have been quicker but for a mistake at the chicane on his second lap on the soft tyres.
The heavily revised BMWs of Robert Kubica and Nick Heidfeld were the last ones to set times, both making it into the top ten. That left Nelson Piquet Jnr, Lewis Hamilton, Nico Rosberg, Timo Glock and Buemi in the drop zone as the final laps began.
Glock and Rosberg escaped the drop zone at their last attempt. Rosberg improved to seventh with a 1’20.256 and made it into Q3 – meanwhile team mate Nakajima was knocked out along with Nick Heidfeld.
Drivers eliminated in Q2
11. Kazuki Nakajima, Williams-Toyota, 1’20.531
12. Nelson Piquet Jnr, Renault, 1’20.604
13. Nick Heidfeld, BMW, 1’20.676
14. Lewis Hamilton, McLaren-Mercedes, 1’20.805
15. Sebastien Buemi, Toro Rosso-Ferrari, 1’21.067
Toyota, Brawn and Red Bull got both of their cars into the final ten, with Massa, Alonso, Kubica and Rosberg joining the competition for pole position.
Barrichello, who had ended Q2 quickest of all, took up place at the top of the times sheets to begin with, setting a 1’21.442. Vettel eclipsed that mark but Massa failed to after making a mistake in the middle sector.
Barrichello’s final lap put him fastest on a 1’20.762 but Vettel had more pace in hand, snatching the squickest time by one tenth of a second.
Meanwhile team mate Button had left it very late to start his final flying lap – crossing the start line with just two seconds to spare after having moved over on his out-lap to let Kubica past.
Button matched Vettel in the first two sectors of the lap but an exquisite final sector – fastest of all by 0.1s – handed him a crucial pole position.
That bumped Barrichello back to third alongside Massa in the improving Ferrari. Unlike last year there were no low-fuel fireworks from home hero Alonso, who lines up seventh behind the Toyotas.
The cars’ fuel loads have been revealed: Button will pit two laps before Vettel (Spanish GP fuel weights and pit stops)
Top ten drivers in Q3
1. Jenson Button, Brawn-Mercedes, 1′20.527
2. Sebastian Vettel, Toro Rosso-Ferrari, 1′20.660
3. Rubens Barrichello, Brawn-Mercedes, 1′20.762
4. Felipe Massa, Ferrari, 1′20.934
5. Mark Webber, Red Bull-Renault, 1′21.049
6. Timo Glock, Toyota, 1′21.247
7. Jarno Trulli, Toyota, 1′21.254
8. Fernando Alonso, Renault, 1′21.392
9. Nico Rosberg, Williams-Toyota, 1′22.558
10. Robert Kubica, BMW, 1′22.685