Australian Mark Webber took back the Formula One championship lead from Lewis Hamilton on Sunday after snatching victory in the Hungarian Grand Prix, writes Alan Baldwin.
McLaren's Hamilton retired with a suspected gearbox failure, only his second blank this season, and dropped to second place overall, four points adrift.
Vettel, started on pole position for the seventh time in 12 races but again failed to convert the advantage and 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."
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.
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.
Mercedes's Nico Rosberg was released from his stop with a loose wheel that then bounced high among the mechanics as cars were coming in. In the mayhem, with a Sauber mechanic luckily catching the wheel, Renault's Robert Kubica drove into Force India's Adrian Sutil - fortunately without injuring any of the pit crew.
Kubica, in what amounts to a home race for the Pole, was handed a 10-second stop-go penalty with a further investigation to be held after the race.
Renault team mate Vitaly Petrov came good for the team, however, with the Russian rookie chalking up his best result in fifth place.
Ferrari's Felipe Massa, back in Hungary a year after an accident that nearly killed him and ended the Brazilian's season, was fourth.
Germany's Nico Hulkenberg was sixth for Williams, with Spaniard Pedro de la Rosa collecting his first points of the season for Sauber in seventh.
Japanese team mate Kamui Kobayashi was ninth and Brazilian Rubens Barrichello 10th for Williams after passing former Ferrari team mate Michael Schumacher despite the German pushing him perilously close to the wall.
The incident was under investigation by stewards.
Team-by-team analysis (listed in championship order)
RED BULL (Mark Webber 1, Sebastian Vettel 3): Webber's fourth win of the season, sixth of his career, in his 150th start and the team's 100th grand prix. Red Bull overtook McLaren at the top in both championships.
MCLAREN (Jenson Button 8, Lewis Hamilton retired): Hamilton lost the overall lead to Webber with his second retirement of the season, this time due to a gearbox failure. World champion Button slipped from second to fourth overall.
FERRARI (Fernando Alonso 2, Felipe Massa 4): Alonso was gifted second place by Vettel's penalty, but he then held the German behind him for more than 30 laps. Alonso is now just 20 points off the lead. Massa, moved up to sixth overall.
MERCEDES (Michael Schumacher 11, Nico Rosberg retired): Schumacher lost 10th place to former Ferrari team mate Rubens Barrichello four laps from the end. Rosberg's wheel came off in the pitstop and hit a Williams mechanic, for which Mercedes were fined $50,000.
RENAULT (Vitaly Petrov 5, Robert Kubica retired): Petrov outqualified his team mate for the first time this season and celebrated his best finish yet. Kubica collided with Sutil's Force India in the pitlane, an unsafe release that cost Renault $50,000.
FORCE INDIA (Vitantonio Liuzzi 13, Adrian Sutil retired): Sutil retired after the collision with Kubica, his first retirement since Australia in March. Liuzzi lost part of his front wing at the first corner and finished three places up from where he started.
WILLIAMS (Nico Hulkenberg 6, Rubens Barrichello 10): Hulkenberg achieved his highest finish so far while Barrichello beat old team mate Schumacher for the final point. Williams mechanic Nigel Hope was knocked down by Rosberg's bouncing wheel but still made it back for the second stop.
SAUBER (Pedro de la Rosa 7, Kamui Kobayashi 9): Sauber marked their 300th race by getting both drivers into the points for the first time this year. De la Rosa scored his first of the season.
TORO ROSSO (Sebastien Buemi 12, Jaime Alguersuari retired): Buemi complained that Schumacher pushed him over to the left at the start. Alguersuari, returning to the circuit where he made his debut last year, retired with engine failure.
LOTUS (Heikki Kovalainen 14, Jarno Trulli 15): Another double finish for the best of the newcomers.
HRT (Bruno Senna 17, Sakon Yamamoto 19): HRT's fifth double car finish of the season, with Yamamoto again replacing Indian Karun Chandhok.
VIRGIN (Timo Glock 16, Lucas di Grassi 18); Glock qualified best of the new teams. Di Grassi had a problem with his left rear tyre at the first pitstop and had to drive slowly round and pit again for more tyres.