BARCELONA, Spain – Lewis Hamilton bested Sebastian Vettel in a tight battle during Sunday’s Spanish Grand Prix at Circuit de Barcelona-Catalunya.

Hamilton got to the checkered flag 3.4 seconds ahead of Vettel, with Daniel Ricciardo a distant third for Red Bull Racing.

The race began with drama. Hamilton and Vettel ran side by side down to turn one, with Vettel’s Ferrari getting the advantage as the Mercedes of Hamilton struggled with wheelspin.

Behind them, Valtteri Bottas in the second Mercedes almost got past Hamilton before tucking back in behind him, but as the Finn rode up the inside kerb his car made contact with the Ferraro if Kimi Raikkonen to his left. The Ferrari was in turn nudged into Max Verstappen as he was trying to go round the outside in his Red Bull. The contact between Raikkonen and Verstappen eliminated both from contention.

Vettel led until pitting to switch to a fresh set of soft Pirelli tires. Hamilton then took over and led until the 21st lap, when he pitted for medium tires. That put Bottas into the lead and Mercedes left him there so he could try to contain Vettel as Hamilton got back up to speed.

Vettel was able to overtake Bottas on the 25th lap and Hamilton also closed in and moved ahead of his teammate. Vettel now had a fast closing Hamilton behind him.

Fate intervened as a crash between Stoffel Vandoorne and Felipe Massa in turn one on lap 34 resulted in a virtual safety car. Mercedes saw an opportunity and called Hamilton down pit road for fresh soft tires, allowing him to rejoin the field right alongside Vettel as the race returned to green flag action.

Hamilton was on the left and got alongside Vettel as they turned into the first corner, with the pair briefly touching. Hamilton was pushed wide, allowing Vettel to keep the lead for the moment.

After following Vettel for six laps, Hamilton made what turned out to be the decisive move of the race. Using his DRS, Hamilton swept by to take the race lead. Once out front there was no catching Hamilton, who pulled away to his second victory of the year.

“It’s been a really good weekend and a great way to bounce back from Russia,” said Hamilton. “It was the rawest fight that I can remember having in a long-time. I loved it, this is why I race. This is what made me get into racing in the first place. This is what the sport needs to be like every single weekend. To have a close battle like that with a four-time champion is awesome.

“I lost out on the start and had to watch Sebastian fly by. He was so fast out in front and it was such a push to keep in touch with him and not let him pull away. I was able to manage my tyres in the first stint and keep relatively close, then it was tricky to keep up on the Medium tyre and then after the second stop. We came out so close together which was super tight into turn one. He didn’t give me much space, it was close. I thought Seb would get me at the end of the final stint but I was able to do it.”

Ricciardo finished a distant third to his Mercedes and Ferrari rivals. He inherited the position when the engine in the second Mercedes of Bottas failed on lap 39.

Force India completed the top-five, with Sergio Perez taking fourth ahead of Esteban Ocon in fifth. Nico Hulkenberg was sixth for Renault, followed by the Toro Rosso of Carlos Sainz Jr., the Sauber of Pascal Wehrlein, Toro Rosso’s Daniil Kvyat and the Haas entry of Romain Grosjean.