Jenson Button won his 200th Grand Prix after mastering changing weather conditions in an enthralling race in Hungary.
The race began on a damp track and everyone started on intermediate tyres. Polesitter Sebastian Vettel held onto the lead through Turn 1 with the McLarens of Lewis Hamilton and Button holding station in second and third. Button tried to pass Hamilton around the outside on the exit and on the run down to Turn 2, but elected to remain in third.
Meanwhile just behind, the two Ferraris of Fernando Alonso and Felipe Massa lost out to the fast-starting Mercedes duo of Nico Rosberg and Michael Schumacher on the exit of Turn 1. Alonso got back through past Schumacher at the end of the second lap, and took fourth back from Rosberg a few laps later despite a couple of off-track excursions.
Up front, Hamilton continued to put pressure on Vettel and finally got through into the lead on lap five after the Red Bull driver ran wide at Turn 2.
On lap ten the drivers began to change to slick tyres. After the stops on lap 13 Button got a better run out of Turn 1 than Vettel and took the position into Turn 2. Just behind, Mark Webber pulled the same move on Alonso for fourth.
Webber and Alonso were the first men to stop for the second time, reacting after Nick Heidfeld's Renault caught fire spectacularly as he drove out of the pits. He stopped at the pit exit, and his car seemed to explode as the marshals put the fire out.
Alonso and Hamilton chose to remain on the supersofts at their second stop, while all of the other leading contenders changed to the prime soft tyre. Alonso managed to jump both Vettel and Webber and into third with his earlier stop.
Button was chasing down Hamilton for the lead, with the latter looking as though he would struggle to need to stop again before the end of the race. However, a sudden rain shower over part of the track threw everything in the air again. It caused Hamilton to spin at the chicane, allowing Button through into the lead.
The McLaren pair continually swapped positions over the subsequent laps as they fought for grip. With Hamilton eventually back in the lead he decided to change to intermediates. The rain soon eased off again, forcing both Hamilton and Webber, who had also made the change, to switch back to slicks again. Hamilton meanwhile was also handed a drive-through penalty after the stewards found him guilty of forcing Paul di Resta off the track after his spin as he tried to get the car pointing in the right direction.
Button was able to take a comfortable victory, with Vettel finishing second to extend his championship lead. Alonso completed the podium in third, while Hamilton got back ahead of Webber to finish fourth.
Massa recovered into sixth after an early spin that dropped him down to ninth and left him with damage to a rear wing endplate. Di Resta scored his best result to date in seventh. Sebastien Buemi finished eighth after moving up from 23rd on the grid. He came out on top of a late scrap that also involved Rosberg and the second Toro Rosso of Jaime Alguersuari who took the remaining points in ninth and tenth respectively. Kamui Kobayashi tried to make it home in the points on a two-stop strategy having run seventh but eventually dropped outside of the top ten and decided to make a late tyre change.
Adrian Sutil and Sergio Perez were also both involved in that scrap, despite being a lap behind them. They dropped back from their top ten grid positions after a first lap incident, and were classified in 14th and 15th respectively at the checkered flag.
Further back, Jerome D'Ambrosio made it to the finish despite a rather hairy moment when he spun on his way into his pit box.
Vettel's championship lead stands at 85 points, with Webber in second. He is three points ahead of Hamilton and four ahead of Alonso. Button remains back in fifth after his recent double retirement. The teams go on a three-week break now ahead of the next race – the Belgian Grand Prix on 28th August.