Lewis Hamilton saved some of Mercedes' blushes as he snatched pole position from under Sebastian Vettel's nose in qualifying for the German Grand Prix.
Earlier, Mercedes had to sit and watch Nico Rosberg get knocked out of Q2 after the team opted not to send him out late in the session.
However, Hamilton made up for the team error as he posted a 1:29.398 after the chequered flag came out to oust Red Bull's Vettel from pole position. Vettel had posted a 1:29.501 just a few seconds earlier, but he was pushed into P2 while Mark Webber was third fastest.
They were followed by the Lotuses of Kimi Raikkonen and Romain Grosjean with Daniel Ricciardo putting in another impressive display to claim sixth spot on Sunday's grid at the Nurburgring.
The sun was beating down at the Nurburgring as the cars came out to face a 42C track, with an ambient of around 24C. Paul Di Resta's Force India headed the timesheets at first; he put in a 1:32.631 on the harder Medium tyre.
The first session was a mix of drivers choosing between the Mediums and the quicker Soft tyre, with an unusually large number of front-runners chosing to limit their running to one lap on Softs. Pastor Maldonado reduced P1 to 1:31.834 despite a front lock-up. Daniel Ricciardo then edged it down to 1:31.081 on the Soft tyre, while Nico Rosberg went P2 on the Medium.
Lewis Hamilton took over P2 also on the Medium, while Fernando Alonso took top spot with a 1:30.709 on Softs.
With just over five minutes left to run there were still only 16 times on the board. Kimi Raikkonen took P1 with a 1:30.709, also on Softs.
With 3:30 left, the dropzone was: 17.Perez, 18.Pic, 19.Bianchi, 20.Van der Garde, 21.Chilton, 22.Button (no time).
Button, out late in the McLaren, jumped up to P6, demoting Sutil to P.17, Adrian then made himself safe in P9. Perez had a poor first lap in his last throw of the dice, staying P18, before coming round a second time and grabbing P14. This pushed Valtteri Bottas - who'd leapfrogged team-mate Maldonado - from P16 to P17.
While all this was happening, Felipe Massa put his Ferrari into P1 with a 1:30.547.
Bianchi looked like winning the new team battles until the final few seconds when Pic demoted him a place. So out wemt: 17.Bottas, 18.Maldonado, 19.Pic, 20.Bianchi, 21.van der Garde, 22.Chilton.
Jean-Eric Vergne set the first time in Q2, a 1:31.285, Paul DiResta lowered it by fractions to a 1:31.258.
Kimi Raikkonen came out on his used Soft tyres and set a 1:30.575 and Lotus team-mate Romain Grosjean slotted into P2. Meanwhile Nico Rosberg lost his first lap after a lock-up into Turn 1. Behind him on the road, Lewis Hamilton set a 1:30.152 - Rosberg was able to come round again and grab P2.
So confident were Mercedes with Nico's time that he stayed in the garage.
Going into the last four minutes the danger positions were: 8.Vergne, 9.Hulkenberg, 10.Button, 11.Gutierrez, 12.Sutil, 13.Ricciardo, 14.Perez, 15.Vettel (no time), 16.Webber (no time).
When the Red Bulls came out, Vettel grabbed P1 with a 1.29.992, while Mark Webber took P3. An indication that the track was beginning to quicken in the closing stages was given by Romain Grosjean who moved himself forward to P2.
Then Fernando Alonso edged out Vettel's top time with a 1:29.962. Times and places began to tumble. Perez took P8, then Felipe Massa took over P1 with a 1:29.825.
Vergne moved up to P10, team-mate Ricciardo took P7 edging his team-mate out of the top ten. Button took P8 which moved Kimi Raikkonen to a dangerous P10, which suddenly became P11 when Hulkenberg pt himself in P8.
Adrian Sutil could only manage P15, while Rosberg was now in P10 and Raikkonen P11. Kimi was out on track but Nico was stuck in the garage. So when Raikkonen made himself safe by taking P2, Rosberg was out: 11.Rosberg, 12.DiResta, 13.Perez, 14.Gutierrez, 15.Sutil, 16.Vergne.
The session was a hammer blow to Nico Rosberg's race chances, but also a hammer blow to Vergne's Red Bull chances, with Toro Rosso team-mate Daniel Ricciardo making it through to Q3. Sauber's Esteban Gutierrez was ahead of Sauber team-mate Hulkenberg for much of the session, and was P8 until the final last-minute shake out.
Kimi Raikkonen set provisional pole with a 1:29.970. He was beaten by Sebastian Vettel with a 1:29.622 before Lewis Hamilton undercut it with a 1:29.540.
After the first runs it was: Hamilton, Vettel, Raikkonen, Webber and Grosjean. Jenson Button came out for a lap on Soft tyres but returned to the pits without setting a time. He then came out again, this time with some Medium tyres but again didn't set a time.
Both Ferraris also came out on Mediums, setting a very slow first lap, and then a faster second lap, but neither were fast enough to challenge the cars using Soft tyres. They would be the first of the Medium runners.
Into the final attempts and Sebastian Vettel took provisional pole with a 1:29.501, just four hundredths of a second quicker than Hamilton. Raikkonen could only manage P3, Daniel Ricciardo a stonking P6, Romain Grosjean took P4, Alonso grabbed P7 and then Massa eased P7 off him.
All eyes in the Mercedes pits turned to Lewis Hamilton who flashed across the line with a 1:29.398. Not only had he got pole for Mercedes in Germany, he was ten places in front of his ultra-competitive team-mate. With the track likely to be up in the 40C area again on Sunday and Red Bull looking good on the long runs from Friday, Hamilton will have a fight on his hands to keep that P1.
1. Lewis Hamilton Mercedes 1m29.398s
2. Sebastian Vettel Red Bull-Renault 1m29.501s +0.103s
3. Mark Webber Red Bull-Renault 1m29.608s +0.210s
4. Kimi Raikkonen Lotus-Renault 1m29.892s +0.494s
5. Romain Grosjean Lotus-Renault 1m29.959s +0.561s
6. Daniel Ricciardo Toro Rosso-Ferrari 1m30.528s +1.130s
7. Felipe Massa Ferrari 1m31.126s +1.728
8. Fernando Alonso Ferrari 1m31.209s +1.811s
9. Jenson Button McLaren-Mercedes No time set
10. Nico Hulkenberg Sauber-Ferrari No time set
Q2 cut-off time: 1m30.269s
11. Nico Rosberg Mercedes 1m30.326s +0.501s
12. Paul di Resta Force India-Mercedes 1m30.697s +0.872s
13. Sergio Perez McLaren-Mercedes 1m30.933s +1.108s
14. Esteban Gutierrez Sauber-Ferrari 1m31.010s +1.185s
15. Adrian Sutil Force India-Mercedes 1m31.010s +1.185s
16. Jean-Eric Vergne Toro Rosso-Ferrari 1m31.104s +1.279s
Q1 cut-off time: 1m31.681s
17. Valtteri Bottas Williams-Renault 1m31.693s +1.146s
18. Pastor Maldonado Williams-Renault 1m31.707s +1.160s
19. Charles Pic Caterham-Renault 1m32.937s +2.390s
20. Jules Bianchi Marussia-Cosworth 1m33.063s +2.516s
21. Giedo van der Garde Caterham-Renault 1m33.734s +3.187s
22. Max Chilton Marussia-Cosworth 1m34.098s +3.551s
Saturday's Shots From Germany