(CNN) -- Mark Webber climbed to the top of the Formula One championship standings with a runaway victory at the Hungarian Grand Prix on Sunday as Red Bull teammate and polesitter Sebastian Vettel paid for a mistake while the safety car was out.
The Australian moved four points clear of previous leader Lewis Hamilton, who retired in the 24th lap of 70 after a mechanical failure ended his hopes of a second successive win at the Hungaroring, where he also triumphed in 2007.
"It was a bit of a gift for me but you know I haven't had many of them," the 33-year-old said after ending his 150th Grand Prix in fine style.
"It was an incredible day for the team. One-two was our goal but we were unfortunate not to get that."
The safety car was already out when the leading McLaren ground to a halt, and its introduction allowed Webber to take the lead having lost second place to Ferrari's Fernando Alonso at the start.
Vettel and Alonso had pitted for the first time on lap 16, allowing Webber to establish a crucial buffer that he kept extending until he also came in for a tire change on lap 44 -- meaning he came back out of the lane still in front.
His fourth victory of the season lifted Red Bull eight points clear in the team standings as previous leaders McLaren's world champion Jenson Button claimed eighth place after starting the race 11th on the grid.
Vettel was hit with a 25-second drive-through penalty after not hearing team radio orders to move clear of Alonso and subsequently dropping too far behind the leader while the safety car was out.
"I didn't understand what was going on and why I was penalized," Vettel told reporters. "I didn't hear anything on the radio after briefly losing connection. I was warming up my car and was sure we had another lap. It's a disappointing day for me."
Alonso, who won last time out at Hockenheim, kept his hopes of a third world title alive as he held off Vettel to take second place -- 17.821 seconds behind Webber -- despite the German setting the fastest lap of any driver.
Vettel moved up to third overall, 10 points behind Webber, despite failing to capitalize on his seventh pole position this year as his early 12-second lead was wiped out.
Alonso remained fifth in the standings, but is now only 20 points off the leader with seven races to go ahead of a four-week break before the next event in Belgium.
Alonso's teammate Felipe Massa, second at the German Grand Prix, was fourth on his return to the circuit where last year he suffered horrific head injuries after a freak accident during qualifying which ended his season.
Renault's Vitaly Petrov finished fifth for the Russian's best result in his debut season, while fellow rookie Nico Hulkenberg of Williams was sixth ahead of Sauber's veteran Pedro de la Rosa.
Button, the winner here for Honda in 2006 for his maiden race win, was next -- a whole lap behind Webber -- while Kamui Kobayashi picked up more points for Sauber. The Japanese driver had started 23rd on the grid after failing to stop for a weigh-in after Saturday's qualifying.
Rubens Barrichello rounded out the top-10 for Williams after overtaking his former Ferrari teammate Michael Schumacher late in the race -- the seven-time world champion faces a stewards inquiry after dangerously pushing his fellow veteran wide of the track.
It was another disappointing day for the German -- who was lapped by Webber -- and Mercedes, with teammate Nico Rosberg retiring on lap 15.
Schumacher's younger compatriot lost his rear right wheel while coming out of the pit lane, but fortunately the flying object did not strike any of the nearby team mechanics.