|Webber salutes the Hungaroring crowd after his victory [AFP] AFP
Australian Mark Webber took back the Formula One championship lead from Lewis Hamilton after snatching victory in a Hungarian Grand Prix.
McLaren's Hamilton retired with a suspected gearbox failure, only his second blank this season, and dropped to second place overall, four points adrift.
Pre-race favourite Sebastian Vettel, starting on pole position for the seventh time in 12 races but again failing to convert the advantage, fell foul of the safety car rules and finished third behind Ferrari's Fernando Alonso.
Webber now has 161 points to Hamilton's 157, with Vettel on 151 and McLaren's world champion Jenson Button on 147.
In one of the closest battles in years, Alonso has 141.
Hamilton pulled over on lap 24, saying there was something wrong with the car. McLaren had expressed concern about his car's brakes before the start but his retirement appeared to be unrelated to that.
"I went through turn one and basically lost drive," he told BBC television.
"I think the gearbox went. That's motorsport. When you push cars to the limit these things can happen. We've lost a lot of points today."
Webber, celebrating his fourth win of the campaign, did everything right after going against the flow and staying out when the other frontrunners pitted for fresh tyres when the safety car was deployed on the 15th of 70 laps.
1 M Webber (AUS) RedBull
2 F Alonso (ESP) Ferrari
3 S Vettel (GER) RedBull
4 F Massa (BRA) Ferrari
5 V Petrov (RUS) Renault
6 N Hulkenberg (GER) Williams
7 P de la Rosa (ESP) BMW Sauber
8 J Button (GBR) McLaren
9 K Kobayashi (JPN) BMW Sauber
10 R Barrichello (BRA) Williams
11 M Schumacher (GER) Mercedes
12 S Buemi (SUI) Toro Rosso
13 V Liuzzi (ITA) Force India
14 H Kovalainen (FIN) Lotus
15 J Trulli (ITA) Lotus
16 T Glock (GER) Virgin
17 B Senna (BRA) HRT
18 L Di Grassi (BRA) Virgin
19 S Yamamoto (JPN) HRT
His hopes were handed a massive boost when the stewards then slapped a drive-through penalty on Vettel for a safety car infringement, which dropped him behind double world champion Alonso.
While Vettel cruised through the pitlane shaking his fists in the air with obvious rage at the officials, the Australian streaked away to build up a sufficient advantage to pit and retain the lead.
Button had a miserable start and languished in 14th place until the safety car deployment, due to debris on the track, triggered chaos in the pitlane and allowed him to get into the points.
The Briton, who had pitted before the safety car, finished eighth – and lapped.
Ferrari's Felipe Massa, back in Hungary a year after an accident that nearly killed him and ended the Brazilian's season, was fourth.
Renault's Vitaly Petrov came good, with the Russian rookie chalking up his best result in fifth place.
Seven times champion Michael Schumacher was handed a 10 place penalty on the starting grid for this month's Belgian Grand Prix for impeding Rubens Barrichello on Sunday.
The governing International Automobile Federation (FIA) said in a statement the four race stewards had ruled that the Mercedes driver had "illegitimately impeded" the Brazilian's Williams during an overtaking manoeuvre.
Schumacher will be dropped 10 positions from wherever he qualifies at Spa on August 28.