He finished just 0.6 seconds ahead of his Mercedes team-mate Nico Rosberg to move on to 100 points for the season and into the lead of the title race ahead of Rosberg, on 97. (Agencies)
Australian Daniel Ricciardo came home third for Red Bull ahead of his team-mate, defending four-time world champion Sebastian Vettel of Germany, who had started from 15th on the grid.
The win was Hamilton's fourth this year, his first in Spain and the 26th of his career while Mercedes one-two stamped their complete supremacy on the constructors' championship which they now lead by more than 100 points.
Finn Valtteri Bottas finished fifth for the resurgent Williams team, ahead of local hero and two-time champion Fernando Alonso and his Ferrari team-mate 2007 champion, Kimi Raikkonen of Finland.
Frenchman Romain Grosjean was eighth for Lotus, signaling their return to some form after a dismal start to the year, ahead of Mexican Sergio Perez and his Force India team-mate German Nico Hulkenberg, who was 10th.
The race began in balmy, but slightly more humid conditions after overnight rain. The track temperature was 37 degrees Celsius and the air 24 shortly before the lights went out.
At the start, the two Mercedes made a clean joint departure while behind them Bottas moved forward to claim third ahead of Ricciardo on the run to the first corner, the longest start straight of the season.
He finished just 0.6 seconds ahead of his Mercedes team-mate Nico Rosberg to move on to 100 points for the season and into the lead of the title race ahead of Rosberg, on 97.