Felipe Massa beat Lewis Hamilton to pole position for the first Grand Prix to be held at the Valencia street circuit.
The duo battled fiercely in Q3, with Ferrari driver Massa initially taking provisional pole by a commanding half a second after Hamilton made an error in the final sector.
Undaunted, Hamilton (McLaren) tried again and on his second run he was able to edge ahead of the Brazilian by 0.2 seconds, only for Massa to find even more time and leap back to the timesheets in a 1:38.989.
After topping final practice, Robert Kubica again showed very strong pace as he grabbed third on the grid for BMW - forcing Kimi Raikkonen's Ferrari and Heikki Kovalainen's McLaren down to fourth and fifth.
But the real star of qualifying was Sebastian Vettel, who was fastest of all in Q2 and then claimed a superb sixth on the grid for Toro Rosso, with his teammate Sebastien Bourdais reaching Q3 for the first time and taking 10th.
Jarno Trulli (Toyota) also had the chance to top a session, leading the way in Q1, and then qualified seventh ahead of BMW's Nick Heidfeld and Williams' Nico Rosberg. The former was fortunate to reach Q3 after having to take to the asphalt run-off in Q1 due to a misunderstanding with Timo Glock in traffic.
One of the biggest shocks of qualifying was home favourite Fernando Alonso's absence from Q3. The former champion had been rapid in both practice and first qualifying, only to run wide over a high kerb on his final Q2 lap and end up 12th, with his Renault teammate Nelson Piquet also struggling in 15th.
Williams' Kazuki Nakajima came within 0.092 seconds of joining teammate Rosberg in the top ten, but there was a bigger gap between the Toyota pair, as Timo Glock lagged half a second behind Trulli and could only qualify 13th.
Red Bull continued to struggle, as they had in practice. Mark Webber made it to Q2, whereas David Coulthard was left 17th, but the Australian was unable to better 14th position.
Also in trouble were Honda, with Jenson Button knocked out in Q1 and left with 16th, and Rubens Barrichello requiring a huge effort just to beat Force India's Adrian Sutil to 19th.
Pos Driver Team Q1 Q2 Q3 Laps 1. Massa Ferrari 1:38.176 1:37.859 1:38.989 19 2. Hamilton McLaren-Mercedes 1:38.464 1:37.954 1:39.199 15 3. Kubica BMW Sauber 1:38.347 1:38.050 1:39.392 18 4. Raikkonen Ferrari 1:38.703 1:38.229 1:39.488 21 5. Kovalainen McLaren-Mercedes 1:38.656 1:38.120 1:39.937 18 6. Vettel Toro Rosso-Ferrari 1:38.141 1:37.842 1:40.142 19 7. Trulli Toyota 1:37.948 1:37.928 1:40.309 21 8. Heidfeld BMW Sauber 1:38.738 1:37.859 1:40.631 19 9. Rosberg Williams-Toyota 1:38.595 1:38.336 1:40.721 18 10. Bourdais Toro Rosso-Ferrari 1:38.622 1:38.417 1:40.750 18 11. Nakajima Williams-Toyota 1:38.667 1:38.428 15 12. Alonso Renault 1:38.268 1:38.435 12 13. Glock Toyota 1:38.532 1:38.499 14 14. Webber Red Bull-Renault 1:38.559 1:38.515 15 15. Piquet Renault 1:38.787 1:38.744 15 16. Button Honda 1:38.880 6 17. Coulthard Red Bull-Renault 1:39.235 9 18. Fisichella Force India-Ferrari 1:39.268 10 19. Barrichello Honda 1:39.811 10 20. Sutil Force India-Ferrari 1:39.943 9 All timing unofficial