Lewis Hamilton made it three pole positions in a row for the first time in his Formula One career as he confounded himself and his team during qualifying at the Hungarian Grand Prix.

In sweltering conditions, as the Hungaroring basked in 33 degree heat and the track temperature hit a rare 50, Hamilton also sizzled in his Mercedes. The 28-year-old Briton dislodged Red Bull's Sebastian Vettel from top spot in a stunning top-10 shoot-out with a flying lap of one minute 19.388secs, leaving the triple world champion 0.034secs adrift.

"Are we on pole?" the Briton shouted over the radio on his slowing down lap. "Yeah, we're as surprised as you," came the reply.

Mercedes headed into the weekend readily conceding they were on the backfoot, with motorsport director Toto Wolff admitting there was no chance of claiming pole. The Brackley-based marque were banned from the young driver test at Silverstone last week when Pirelli debuted their new specification of tyres, as a punishment for a "secret" test with Pirelli in Spain in May.

Marrying last year's construction with this season's compounds, the tyres have been introduced for safety reasons after a number of blow-outs occurred during the British Grand Prix last month.

Mercedes initially struggled during practice as they gathered the necessary data required to make the correct calls on set up.

"With the temperatures, it was pretty tough. I was really surprised when they said I got pole," said Hamilton, who won from pole last year in Hungary but has yet to win a race since leaving McLaren at the end of the 2012 season.

"I didn't feel like that was a great lap. I was expecting Sebastian to get it. Pole definitely helps, of course because it's very difficult to follow here, but it is a long way down to turn one. If you can hold pole into turn one then it will be advantageous, but as always the race is going to be about the tyres and trying to hold on to them [to avoid degradation].

"We brought some upgrades this weekend, the guys are working hard and it's a result of all the hard work they've put in."

Frenchman Romain Grosjean qualified third for Lotus with Hamilton's German team-mate Nico Rosberg fourth. Fernando Alonso, who has not started on pole for more than a year and turns 32 tomorrow, will start fifth.

"These guys [Vettel and Grosjean] are going to be ridiculously fast, so trying to keep in front or hold on to them is going to be the challenge," Hamilton said.

Vettel, who dominated Friday practice but has never won in Hungary, was not too disappointed, saying there was not much missing from his two attempts at pole, and added that "Lewis did a great job".

He said: "I was happy with both laps, although the middle sector on the second lap wasn't that great. But it's always easy with hindsight to say you could have done more here, more there.

"Overall, it was just not quick enough. I'd surely love to be a bit faster, but we're still in a great place for tomorrow. We should have a good race because the car feels fine."

But Alonso, who trails Vettel by 34 points in the standings, is confident he can close that gap.

"Today's result is positive, being fifth on a track that historically has not been so good for Ferrari," he said. "To be closer to pole position is good news, so tomorrow hopefully we can recover some positions and deliver some points from the race.

"I believe I now have a very realistic chance of closing the gap to Sebastian. Starting eighth or ninth, as I have in the last two races, and he is on pole then there is no way we can get to him, either at the start or with a different strategy, but with him second, me fifth, my first opport-unity will be at the first corner."

Paul Di Resta endured another tough Saturday afternoon in the cockpit of his Force India. Seemingly struggling with the new construction of tyres, the Scot starts 18th following his worst qualifying performance this year.

"Where did the grip and tyres go?" the Scot asked his team over the radio.

"Looks like we've got some work to do," they replied.