BUDAPEST, Hungary (AP) — Lewis Hamilton heads into Formula One's summer break with a comfortable 24-point lead over rival Sebastian Vettel after cruising to victory from pole position at the Hungarian Grand Prix on Sunday.

Hamilton was untroubled as he secured a second straight win, his fifth of the season and 67th overall. Vettel was second.

"It's great to go into the break with back-to-back wins," said Hamilton, who won in Germany last week. "That boost will last a long time with our team."

After 12 of 21 races, defending champion Hamilton has the momentum. At the same stage last season, he trailed Vettel by 14 points.

"What a beautiful day, what a great car," said Hamilton, who won by 17 seconds. "We've had an amazing job by the team and we came here with Ferrari pushing."

Mercedes missed out on a 1-2 as Valtteri Bottas was overtaken by Vettel and Kimi Raikkonen with five laps to go.

Bottas and Vettel touched during the overtaking move, with some debris flying off the Mercedes.

"I got a hit from behind. I wasn't sure what was going on," Vettel said. "Lucky that the car wasn't broken and we could carry on."

In a dramatic finish, Bottas lost control of his car as he bumped Daniel Ricciardo's Red Bull off the track as he was about to be overtaken.

"I just ended up being a mess in the end with a broken car," Bottas said.

Bottas was told on team radio to give the position back to Ricciardo, who finished a commendable fourth after starting 12th. Bottas was later given a 10-second time penalty but this did not affect results, with Toro Rosso's Pierre Gasly remaining in sixth place.

Ricciardo's teammate, Max Verstappen, launched a series of expletives after engine failure curtailed his race after eight laps.

"It was difficult to accept and I was very upset over the radio," Verstappen said. "The fans are disappointed, they came all this way and only see you do five or six laps."

It is the fourth time Verstappen has failed to finish this season. Red Bull team principal Christian Horner blamed the Renault engine as being substandard. Red Bull is splitting with Renault and working with Honda next season.

Hamilton and Vettel will continue their battle for a fifth F1 title when the championship resumes at the Belgian GP on Aug. 26.

Hamilton celebrates after clinching his first career Formula One championship at the Brazilian Grand Prix in Sao Paulo in Nov. 2008. Hamilton became the youngest champion in Formula One history. Antonio Scorza, AFP/Getty Images

Interested in this topic? You may also want to view these photo galleries:

Vettel and Raikkonen drove well considering both endured a botched pit stop because of a slow tire change.

Ferrari team strategy meant Raikkonen pitted twice for new tires and — on a scorching hot day — Ferrari bafflingly forgot to properly attach his drinks supply.

"It's nice to get some water in the mouth sometimes," Raikkonen said. "Apart from that, it wasn't an issue."

Hamilton secured pole with a brilliant last lap in the rain on Saturday, while Vettel started a modest fourth behind Raikkonen and Bottas.

"Qualifying was a very important day for us," said Hamilton, referring to the fact Ferrari was expected to be quicker.

The long straight up to Turn 1 was Ferrari's best and — ultimately — only chance of overtaking Hamilton. But he comfortably held position while Vettel jumped ahead of Raikkonen and almost caught Bottas.

Hamilton's win here followed his victory at last weekend's rain-soaked German GP, where he was handed victory after Vettel crashed late on while leading.

Mercedes decided to bring Hamilton in Sunday for his only tire change on Lap 26. He came out second behind Vettel — the only time Hamilton did not lead.

Ferrari pitted Raikkonen for a second tire change on Lap 39, and Vettel finally came in the next lap.

But it was another poor stop from Ferrari, whose mechanics struggled to fit the front left tire. The stop took four seconds — roughly double the ideal time — and when Vettel emerged on track he was behind Bottas.

On arguably the most difficult track for overtaking in F1 after Monaco, it greatly reduced Vettel's hopes of finishing second. But with Bottas struggling with his rear tires, Vettel seized his chance.

Before the race, a minute's silence for former Ferrari president Sergio Marchionne was impeccably observed.

Marchionne, a hugely influential and successful automobile industry leader, died after complications from surgery.

Sebastian Vettel won his third straight championship in 2012 by clipping Fernando Alonso by three points. Vettel won five races, including four straight from races 14-17, on the season. Paul Gilham, Getty Images