(CNN) -- Australian Mark Webber led from start to finish to win the Spanish Grand Prix in Barcelona on Sunday.
Spain's Fernando Alonso in a Ferrari finished second with Webber's teammate Sebastian Vettel completing the podium positions.
Former world champion Lewis Hamilton was in second place until the penultimate lap when the front tire on his McLaren punctured and he ploughed into the barrier.
Hamilton was unhurt, but the 18 points that disappeared in an instant could cost him dear in the title race which is still being led by his teammate Jenson Button, who finished fifth at the Circuit de Catalunya.
Button spent a frustrating afternoon trying to get past Michael Schumacher, who put up an improved performance to claim fourth for Mercedes, the best result of his comeback season to date.
He has seen his lead in the title race cut to three points by Alonso, with Vettel 10 points adrift and a further seven ahead of Webber.
Hamilton is in sixth place, 21 points behind his British compatriot.
McLaren lead the constructors' championship, but their advantage over Ferrari has been cut to three points, with Red Bull a further three points behind in a close battle.
Other drivers in the points positions were Felipe Massa of Ferrari in sixth, Force India's Adrian Sutil in seventh and Robert Kubica for Renault in eighth.
Veteran Brazilian Rubens Barrichello in his Williams finished ninth with the final point claimed by Spaniard Jaime Alguersuari for Toro Rosso.
It was Webber's first win since last year's Brazilian Grand Prix and he was naturally delighted.
"Collectively it has been a huge job by everyone at Red Bull," he told the post-race press conference.
"It was a fantastic result, everyone has done their part including the drivers, and I'm absolutely thrilled."
The circuit now moves on to the playground of the rich, Monte Carlo, for the Monaco Grand Prix next weekend.