With wet track conditions at the beginning of the 70-lap race, Red Bull's Sebastian Vettel started on pole and led the first four laps before he slid wide off course and allowed Button's teammate, Lewis Hamilton, to overtake him for the top position.

Hamilton ran in front for a majority of the race at the Hungaroring, but as the rain intensified in the late-stages, Hamilton spun around, and Button assumed the lead.

As Hamilton maneuvered around after his spin, he nearly crashed into Paul di Resta. Race stewards gave Hamilton a drive-through penalty for the incident, which cost the Brit a chance to win his second race in a row. He won last week's German Grand Prix.

Button took command for the remainder of the race, finishing 3.5 seconds ahead of Vettel for his second win of the season and the 11th of his career. His first F1 came victory in the 2006 Hungarian GP, a race also affected by rain.

"It's a great moment," Button said. "For some reason I like these conditions. Don't ask me why, but it worked out again. It was a great call by the team to put me on the prime tire when they did. We decided not to go with the [intermediate tires]. It was an amazing weekend all around."

The Hungarian GP featured an F1 record 88 pit stops due to the weather. Button and Vettel made just three stops, while Hamilton was forced to pit six times, including one for his penalty. Hamilton wound up finishing in fourth.

"I'm disappointed in myself for spinning," Hamilton said. "I had to do a doughnut to get myself facing the right way, and that forced Paul onto the grass, which is why I got the drive-through penalty. I've apologized to Paul, and I'll put the penalty behind me and move on to the next race."

With his second place run, Vettel, the defending world champion, padded his lead to 85 points over teammate Mark Webber, who finished fifth.

"I was struggling a bit on the intermediate tires during the first stint," Vettel said. "Lewis was a bit faster. I lost it down into turn two, since it was quite tricky. He was pushing quite hard, and I tried to be on the edge. It was quite slippery, and it was easy to have a spin. I lost the lead after that."

Hamilton trails Vettel by 88 points, while Ferrari's Fernando Alonso, the third-place finisher, is one marker behind Hamilton heading into the three- week "summer break" for F1. The racing circuit does not return to action until the Belgian Grand Prix the last weekend in August.

Ferrari's Felipe Massa finished sixth, followed by di Resta from Force India and Toro Rosso's Sebastien Buemi, who qualified 18th on Saturday but started 23rd due to a five-spot grid penalty he received for colliding with Nick Heidfeld last week in Germany.

Heidfeld had a scary moment early in the Hungarian GP when his Renault erupted into flames after he exited pit lane. He pulled his car on the grass, while marshals quickly arrived on the scene to extinguish the flames.

"My first thought when I saw a little bit of smoke was 'let's go, maybe the wind will put it out,' as that's what has happened before," Heidfeld told BBC Radio. "This time the smoke kept coming, and then I saw the fire coming quite close, so I jumped out. Afterwards, there was a small explosion which I've not seen before on an F1 car."

Mercedes' Michael Schumacher, a four-time Hungarian GP winner, had his race cut short early due to a faulty gearbox. Schumacher finished 22nd. It was the first time he retired in this race since 1993.