Felipe Massa led a shock Williams one-two in qualifying for the Austrian Grand Prix.
The Brazilian's last-gasp effort knocked team-mate Valtteri Bottas off top spot in the final seconds of qualifying, giving him pole by just under a tenth of a second.
It was Massa's first pole since the 2008 Brazilian GP and the first for Williams since the 2012 Spanish GP.
World championship leader Nico Rosberg was third fastest after failing to improve on his final attempt, but while he missed out on top spot he will be happy to see title rival Lewis Hamilton down in ninth.
Hamilton's first run in Q3, which would have been good enough for fifth on the grid, was disallowed for exceeding track limits at the exit of Turn 8 after the rear stepped out.
His second attempt was ruined by a spin at Turn 2, meaning that he did not set a time, putting him ahead of only the Force India of Nico Hulkenberg.
Fernando Alonso was just over half-a-second off the pace in fourth place.
Daniel Ricciardo was fifth fastest ahead of McLaren's Kevin Magnussen, with Daniil Kvyat a superb seventh.
Kimi Raikkonen was the slowest of those actually to register a lap time in Q2, ending up eighth.
Sergio Perez was 11th after being bumped out of a Q3 position late on, missing out by just under a tenth of a second.
But he will start 16th thanks to the five-place grid penalty he received for causing a collision with Massa in the Canadian GP two weeks ago.
The Mexican's former team-mate Jenson Button, whose morning practice session was ruined by a rear brake problem, and Sebastian Vettel, whose lack of pace in the final sector cost him, were just behind Perez.
Pastor Maldonado outqualified Lotus team-mate Romain Grosjean for the first time this year, the pair sandwiching 15th-placed Jean-Eric Vergne's Toro Rosso.
Adrian Sutil was the fastest of those to be knocked out in Q1, ending up just four-thousandths slower than Maldonado.
He was comfortably ahead of Sauber team-mate Esteban Gutierrez, with Jules Bianchi 19th fastest.
Kamui Kobayashi did a good job to split the Marussias, a tenth faster than Max Chilton, with Marcus Ericsson unable to improve on his second run and ending up last.
Numerous drivers had lap times automatically disallowed during the session for running wide beyond track limits at the exit of Turn 8.
Pos Driver Team Time Gap 1. Felipe Massa Williams-Mercedes 1m08.759s 2. Valtteri Bottas Williams-Mercedes 1m08.846s +0.087 3. Nico Rosberg Mercedes 1m08.944s +0.185 4. Fernando Alonso Ferrari 1m09.285s +0.526 5. Daniel Ricciardo Red Bull-Renault 1m09.466s +0.707 6. Kevin Magnussen McLaren-Mercedes 1m09.515s +0.756 7. Daniil Kvyat Toro Rosso-Renault 1m09.619s +0.860 8. Kimi Raikkonen Ferrari 1m10.795s +2.036 9. Lewis Hamilton Mercedes 10. Nico Hulkenberg Force India-Mercedes Q2 cut-off time: 1m09.657s Gap ** 11. Sergio Perez Force India-Mercedes 1m09.754s +0.780s 12. Jenson Button McLaren-Mercedes 1m09.780s +0.806s 13. Sebastian Vettel Red Bull-Renault 1m09.801s +0.827s 14. Pastor Maldonado Lotus-Renault 1m09.939s +0.965s 15. Jean-Eric Vergne Toro Rosso-Renault 1m10.073s +1.099s 16. Romain Grosjean Lotus-Renault 1m10.642s +1.668s Q1 cut-off time: 1m10.821s Gap * 17. Adrian Sutil Sauber-Ferrari 1m10.825s +1.311s 18. Esteban Gutierrez Sauber-Ferrari 1m11.349s +1.835s 19. Jules Bianchi Marussia-Ferrari 1m11.412s +1.898s 20. Kamui Kobayashi Caterham-Renault 1m11.673s +2.159s 21. Max Chilton Marussia-Ferrari 1m11.775s +2.261s 22. Marcus Ericsson Caterham-Renault 1m12.673s +3.159s 107% time: 1m14.379s
* Gap to quickest in Q1
** Gap to quickest in Q2