Lewis Hamilton put any concerns about the heat to one side to claim his 30th career pole position and his fourth at the Hungarian GP.
Although Sebastian Vettel appeared to have the edge over his rivals in qualifying, Hamilton put in a blistering 1:19.388 to take P1 in the dying seconds of Q3.
Romain Grosjean, who set the pace in final practice, was third quickest ahead of Nico Rosberg while Fernando Alonso once again qualified in his familiar fifth place.
The sun was beating down at the Hungaroring with temperatures around 32C and 33C with the track at the start of the session at 48C (and likely to be more than that on race day).
As Esteban Gutierrez headed out onto the circuit, the mechanics in the McLaren garage were still working hard on Sergio Perez's car, damaged at both ends in the final moments of FP3 this morning.
With the race expected to be in the 50C - 55C range tomorrow, teams were saving their Medium tyres for Sunday and heading straight out on the Softs. Valtteri Bottas set the first meaningful P1 for Williams at 1:21.532.
It is a circuit that is very little used outside of grands prix, and so the surface of the Hungaroring speeds up with every session. After eight minutes, only 11 car had set a time, the heavy hitters remaining in the garage - all bar Nico Rosberg who was still experimenting with set-up.
Daniel Ricciardo re-set P1 at 1:21.181 while team-mate Jean-Eric Vergne (who is not being considered for the Red Bull drive next year) was back in P3.
With seven minutes of the session left to run and the track now at 50C Alonso was the first of the front-runners to go for a time. He duly reduced P1 to 1:20.652 and Kimi Raikkonen slotted into P2 behind him.
His fellow Lotus driver, Romain Grosjean, had looked faster than Raikkonen for most of the weekend and he knocked Alonso off the top of the timesheets with a 1:20.477. Sebastian Vettel could only manage P2.
With three minutes of the session left to run the danger positions were: 15.Pic, 16.Van der Garde, 17.Bianchi, 18.Chilton, 19.Gutierrez, 20.Perez (no time), 21.Rosberg (no time), 22.Hamilton (no time).
Sergio Perez got his Mclaren back with six minutes of the session to run and duly delivered a P10 time, Gutierrez scrambled forward to P14.
The two Mercedes cars unleashed their full potential with Nico Rosberg claiming P1 with a 1:20.350 and Lewis Hamilton just 0.013 slower.
Pastor Maldonado jumped forward to P6 which then left: 15.Perez, 16.Vergne, 17.Gutierrez, 18.DiResta.
Paul Di Resta couldn't improve his place and stayed P18 - Vergne jumped up to P14 pushing Sergio Perez close to the drop zone in P16. The Mexican was on a faster lap, but with Gutierrez not improving he was able to come in and save tyre wear.
So out went: 17.Gutierrez, 18.DiResta, 19.Pic, 20.Van der Garde, 21.Bianchi, 22.Chilton.
It was a depressing result for Paul Di Resta at a time when other team bosses need to be impressed. Team-mate Adrian Sutil would ultimately finish in P11.
Qualifying 2Having underperformed in comparison to his team-mate in Q1, Kimi Raikkonen was anxious to get out and get on with it in Q2. He set the first P1 time at 1:20.987.
As Kimi was completing his lap, news came on team radio that Mark Webber's KERS had failed (yet again).
Romain Grosjean lowered the P1 time of his team-mate to 1:20.442, Romain was one of the many drivers to complete their first lap in Q2 on a set of used Soft tyres from Q1. Lewis Hamilton edged the top time down to 1:20.303, before Sebastian Vettel registered his intent with a 1:19.992 - that despite a lock-up.
With five minutes to go the danger positions were: 5.Alonso, 6.Sutil, 7.Massa, 8.Raikkonen, 9.Button, 10.Perez, 11.Bottas, 12.Ricciardo, 13.Webber, 14.Vergne, 15.Hulkenberg, 16.Maldonado.
Because everyone had a new set of Softs to throw at their final lap even Lewis Hamilton in P2 didn't feel safe and took to the track again. Kimi Raikkonen jumped to P2, Grosjean replaced him in P2. Nico Rosberg took P1 with a 1:19.778 and Lewis Hamilton came in a tenth behind him.
Fernando Alonso made himself safe in P4, Maldonado jumped up to a very temporary P9 pushing the McLarens back to P11 and P12. Ricciardo made it into the top 10 yet again with P7 while team-mate Vergne could only make P11.
Mark Webber was languishing in the dropzone but got up to P7 and Felipe Massa also rescued himself from the dropzone into P7. Sergio Perez jumped back to P10, but an understeering Jenson Button could only manage P13.
So out went: 11.Sutil, 12.Hulkenberg, 13.Button, 14.Vergne, 15.Maldonado, 16.Bottas.
Vergne was over a half second behind his team-mate, but Button - who has won twice in Hungary - was surprised to have been beaten by Perez.
Sergio Perez realised he couldn't make much of an impression on the cars in front so opted to qualify on the medium tyres ready for the race - his 1:24.852 was never going to take pole.
Kimi Raikkonen set the provisional pole time with a 1:20.533 that included a lurid slide from his rallying days in the final corner. Nico Rosberg took a set of used Softs to beat that with a 1:20.387 and then Lewis Hamilton edged him out with a 1:20.324, also on a used set.
Sebastian Vettel strapped on a set of new Softs for his first pole tilt and it produced a blistering 1:19.5 - surely no-one could beat that, it was eight-tenths up on Hamilton's time.
After the first runs the positions were: Vettel, Hamilton, Rosberg, Grosjean, Raikkonen, Massa, Alonso, Perez.
Perez improved his Medium run pace to a 1:22.398, but the only person that time was going to beat was a car not setting a time - and due to the ongoing KERS saga and gearbox issues Mark Webber jumped out of his car before the session had ended. It would give Sergio P9 and the clean side of the grid!
Out the cars came for their second runs - Nico Rosberg produced a purple (fastest) Sector 1 of 28.6 and then Lewis Hamilton bettered it with a 28.5.
Raikkonen crossed the line to take P2. Grosjean immediately took it off him, Nico Rosberg, despite his great early lap could only manage P3, Alonso grabbed P4.
Then Lewis Hamilton broke the timing beam with an amazing 1:19.388, almost a second quicker than his first lap, and Vettel improved but had no answer, crossing the line with a 1:19.426.
The race may be another thing, but for the moment Mercedes had re-established themselves at the front, on their new Pirelli rubber. How long it lasts on Sunday with track temperatures predicted to get to 55C is anyone's guess, but for now the Mercedes team were just happy to have got one over the auld enemy.
Those starting on the grid's even numbers will be very keen to see it cleaned before the race as it is a notorious brake on a car's getaway - with Alonso and Massa in P5 and P7 there could well be fireworks at the first corner.
01. Lewis Hamilton Mercedes 1m19.388
02. Sebastian Vettel Red Bull-Renault 1m19.426 +0.038
03. Romain Grosjean Lotus-Renault 1m19.595 +0.207
04. Nico Rosberg Mercedes 1m19.720 +0.332
05. Fernando Alonso Ferrari 1m19.791 +0.403
06. Kimi Raikkonen Lotus-Renault 1m19.851 +0.463
07. Felipe Massa Ferrari 1m19.929 +0.541
08. Daniel Ricciardo Toro Rosso-Ferrari 1m20.641 +1.253
09. Sergio Perez McLaren-Mercedes 1m22.398 +3.010
10. Mark Webber Red Bull-Renault no time set
11. Adrian Sutil Force India-Mercedes 1m20.569 +0.791
12. Nico Hulkenberg Sauber-Ferrari 1m20.580 +0.802
13. Jenson Button McLaren-Mercedes 1m20.777 +0.999
14. Jean-Eric Vergne Toro Rosso-Ferrari 1m21.029 +1.251
15. Pastor Maldonado Williams-Renault 1m21.133 +1.355
16. Valtteri Bottas Williams-Renault 1m21.219 +1.441
17. Esteban Gutierrez Sauber-Ferrari 1m21.724 +1.374
18. Paul di Resta Force India-Mercedes 1m22.043 +1.693
19. Charles Pic Caterham-Renault 1m23.007 +2.657
20. Giedo van der Garde Caterham-Renault 1m23.333 +2.983
21. Jules Bianchi Marussia-Cosworth 1m23.787 +3.437
22. Max Chilton Marussia-Cosworth 1m23.997 +3.647