Ferrari driver Sebastian Vettel of Germany steers his vehicle during the Spanish Formula One Grand Prix at the Barcelona Catalunya racetrack in Montmelo, Spain, Sunday, May 14, 2017.
Hamilton's teammate Valtteri Bottas also dropped out after his Mercedes engine failed midway through the race.
"I was really happy, but after thinking I lost a lot of time in the adventure, so I was not so happy because the real battle was with Lewis", Vettel said.
Hamilton finished the 66-lap contest 3.5 seconds ahead of the four-time champion German, having blasted past him to regain the lead after 44 laps.
"I probably lost two kilos just in that race", added the Mercedes driver, who revealed he had no water bottle in his vehicle in order to save weight.
Though they disagreed over the incident after the race, they did so with a laugh, and Vettel says the two men have a mutual respect from their love of what they do.
Red Bull's Daniel Ricciardo joined Hamilton and Vettel on the podium after the Australian took advantage of a first-lap collision involving Valtteri Bottas, Kimi Raikkonen and Max Verstappen.
Bottas, who celebrated his first career victory in Russian Federation two weeks ago, made glancing contact with his compatriot and the impact pitched Raikkonen into Verstappen on the other side, smashing the suspension on both cars.
"It all started when I got hit, my vehicle jumped a bit and you can not control after that", Raikkonen said.
Hamilton began on pole position but lost his lead to Vettel on the first lap.
Hamilton, who was breathless with the effort he made, was equally thrilled by their duel, including one flashpoint when the paid made contact at Turn One after Vettel's second pit stop.
It was a strategic race, with the decision by Mercedes to run a longer first stint, and then using the harder Pirelli compound mid-race proved inspired.
While Vettel used his two sets of faster tires first before finishing on the more long-lasting but slower ones, Hamilton used his more conservative tires after his first pit stop, allowing him to finish on the faster set.
"That's how racing should be and I loved it", said a happy Hamilton, who raced side by side with Vettel at turn one after the German's final pitstop.
"I was trying to get the most out of it, but seeing the lap times they were doing at the end, we have still got a bit to go".
Moments after Bottas saw his hopes of adding to a maiden win in the previous round go up in smoke, Hamilton closed in on Vettel on his faster tires and never looked back after going by on lap 43. "If he had hit me in Turn One and I didn't finish and he won the race, it would not have been "great job, Sebastian", said Hamilton.
Mexican Sergio Perez finished fourth, his 15th successive points finish, for Force India with French rookie team mate Esteban Ocon fifth.
Nico Hulkenberg (Renault), Carlos Sainz (Toro Rosso), Pascal Wehrlein (Sauber), Daniil Kvyat (Toro Rosso) and Romain Grosjean (Haas) rounded out the points.
Fernando Alonso crossed the line in 12th - his first finish of the season - but there was more misery for Britain's Jolyon Palmer, who limped home last of all the classified runners.
The virtual safety vehicle was deployed when Stoffel Vandoorne crashed into Felipe Massa and Mercedes caught Ferrari on the hop by pitting Hamilton.