Mark Webber won the Hungarian GP in his Red Bull and took the championship lead after Sebastian Vettel’s chances of a dominant victory were ruined by a penalty for the German.
Fernando Alonso finished second with Vettel completing the podium in third place.
Vettel led comfortably from Fernando Alonso’s Ferrari until a safety car period to remove debris from the circuit shook up the order.
Webber was the only frontrunner not to pit under the safety car and took the lead of the race. The Australian then eased clear from second placed Alonso and built up a sufficient lead to be able to take his pitstop and still emerge in front of the Spaniard.
Vettel’s challenge ended when he was given a drive-through penalty for not keeping within 10 car lengths of Webber under the safety car. Vettel finished third and has now failed to win on six out of the seven occasions he has started on pole this season.
Hamilton lost the championship lead after retiring and his McLaren teammate Jenson Button had a tough weekend, finishing in eighth place.
There were two incidents in the pit lane during the safety car period – the right-rear wheel detached from Nico Rosberg’s Mercedes before bouncing down the pitlane and Robert Kubica’s Renault collided with Adrian Sutil’s Force India.
Late in the race, Michael Schumacher nearly pushed Rubens Barichello into the pit wall as the Brazilian tried to overtake. The German has been given a 10-place grid penalty for the next round at Spa-Francorchamps in Belgium on 29 July.
Just 20 points now cover the top five drivers in the championship, with 25 awarded for a win.