Lewis Hamilton ensured he would head into the Formula 1 summer break on a high by taking a dominant win in Sunday's Hungarian Grand Prix, extending his championship lead to 24 points as a strategy miscue cost Sebastian Vettel a shot at victory.

After taking pole position in a rain-soaked qualifying session on Saturday, Hamilton was able to convert it into his sixth win at the Hungaroring as he taught his rivals a lesson in race management, looking after his tyres carefully to make a one-stop strategy work in warm conditions.

Starting fourth, Vettel opted to start the race on the Soft compound tyre, and got the jump on Ferrari teammate Kimi Raikkonen on the opening lap to run behind Hamilton and the sister Mercedes of Valtteri Bottas, both of whom took Ultrasofts for the first stint.

Hamilton was able to pull out a healthy gap over Bottas in the first stint before pitting at the end of Lap 25, with Vettel moving into the lead and pushing hard in a bid to try and extend his lead before pitting late in the race for Ultrasofts.

Vettel's pace matched that of both Mercedes drivers, giving Ferrari hope of victory, with the gap to Bottas being around the time needed to take a pit stop. Were Vettel to pit and emerge in second place, he would have plenty of clear track to put the hammer down on his fresh Ultrasofts and catch Hamilton.

But the tight nature of the Hungaroring meant traffic hindered Vettel's charge, costing him around four seconds in the lead-up to his pit stop at the end of Lap 39. More time was lost in the pits as the Ferrari crew struggled to fit Vettel's front-left tyre, meaning that when he finally exited the pits, Bottas had already swept past to take second place, with Hamilton a further 10 seconds up the road.

Vettel wasted little time in closing up on Bottas in second place as the Finn struggled on his Soft tyres, while Ferrari tried to bluff Mercedes into a second stop by bringing Raikkonen - running net fourth - in again. Bottas held firm in P2, making his W09 car as wide as possible, refusing to let Vettel past.

Vettel continued to cook his Ultrasoft tyres while running in Bottas' dirty air, allowing Hamilton - who had reined in his pace in the early part of his Soft stint - to pull clear with a series of personal best lap times after managing his tyres perfectly. The Briton ultimately went untroubled in the closing stages of the race, crossing the line 17 seconds clear for his fifth win of the season and the 67th of his F1 career.

The battle for second was settled with five laps to go in dramatic fashion when Vettel and Bottas' fight ended in contact at Turn 2. After getting close through the final corner, Vettel was able to pull ahead exiting Turn 1 and move into second. Bottas refused to back down, trying to hold the position at the inside of Turn 2, only to clumsily make contact with Vettel's left-rear wheel. Vettel was able to continue despite the nudge, while Bottas dropped back behind both Ferrari drivers.

Having avoided any damage, Vettel managed to hold on to second place ahead of Raikkonen, limiting the damage of Hamilton's victory as best possible. Hamilton will head into the summer break leading the drivers' championship by 24 points.

Just two laps after the clash with Vettel, Bottas found himself caught up in another incident as he tried to defend fourth place from Daniel Ricciardo. As Ricciardo tried to go around the outside at Turn 1, Bottas ran deep, causing the pair to make contact. The stewards quickly confirmed they would be investigating the incident, with Mercedes reacting by telling Bottas to let Ricciardo past, much to the Finn's frustration. Ricciardo crossed the line fourth ahead of Bottas in P5.

Pierre Gasly finished at the head of the midfield after a relatively lonely race for Toro Rosso, crossing the line in sixth place. Gasly managed to get the jump on Carlos Sainz Jr. on the opening lap and never looked back, finishing as the final driver on the lead lap. It also marked his second-best finish in F1. Kevin Magnussen followed in seventh place for Haas, finishing 13 seconds back from Gasly.

Fernando Alonso returned to the points after one race away, perfecting a long first stint before getting the overcut on his midfield rivals to finish the race eighth. The Spaniard had been closely followed by McLaren teammate Stoffel Vandoorne on-track, with the Belgian set for his first points since Baku before a suspected gearbox failure caused him to slow on-track and retire from the race.

Sainz recovered from a difficult first lap to finish ninth for Renault ahead of Romain Grosjean, who rounded out the points in the second Haas. Grosjean was able to leapfrog Brendon Hartley in the pits as the New Zealander finished an agonising 11th for Toro Rosso, missing out on points by just 1.3 seconds.

Nico Hulkenberg recovered to 12th after making a late second stop under the Virtual Safety Car called for Vandoorne's stoppage, finishing ahead of the Force India duo of Esteban Ocon and Sergio Perez. Marcus Ericsson finished 15th for Sauber, with the Williams pair of Sergey Sirotkin and Lance Stroll finishing 16th and 17th as the last classified finishers.

Besides Vandoorne, Max Verstappen and Charles Leclerc were the only other retirements from the race. Verstappen reported a loss of power on Lap 5, forcing him to park up, while Leclerc got caught up in backmarker contact on the opening lap, resulting in his retirement.

The F1 season returns in four weeks' time with the Belgian Grand Prix at Spa-Francorchamps.