Lewis Hamilton won the Spanish Grand Prix on Sunday to chalk up his fourth victory in a row and wrest the Formula One championship lead from Mercedes team-mate Nico Rosberg.

In what was also the fourth successive Mercedes one-two, and fifth win in five races for the dominant German constructor, Hamilton took the chequered flag a mere 0.6 of a second ahead of his rival.

The Briton now has 100 points to Rosberg's 97 after his 26th career victory and leads the standings for the first time since 2012.

Australian Daniel Ricciardo was third for champions Red Bull in the first podium finish of his Formula One career after being stripped of second for a fuel irregularity in his home season-opener in Melbourne in March.

This race is likely to be one that will hurt Rosberg for some time ahead of Formula One's blue riband event in Monaco in a fortnight.

Although Hamilton was clean away from pole, the 29-year-old grumbled often throughout the race, complaining about oversteer, the back end of the car sliding out, graining on his tyres, his strategy, how much time he had lost to Rosberg in the pit stops.

At times it was a nervous, tetchy Hamilton behind the wheel, whereas Rosberg appeared to drive serenely behind as he managed the gap to his championship rival.

To give the German his shot at victory, Mercedes altered tyre plans from the first stop onwards, and as the race reached its denouement Rosberg reeled Hamilton in.

But despite finally managing to get within a second late on, Rosberg ran out of laps and not once had a crack at making a pass on Hamilton.

Hamilton also has history on his side because on every one of the 19 previous occasions a driver has won four in a row he has gone on to claim the world championship.

As wins go, Hamilton's first in Spain, this one was crucial.

"It means everything to me," Hamilton said. "Getting my first grand prix win here after being in the sport eight years, it's very difficult to put the feeling into words when you have a result like this.

"Never have I had a car like this, nor a gap like this to anyone before.

"But I know I wasn't fast enough. Nico was quicker, I struggled with the balance, but fortunately I was able to keep him behind.

"I really had to rely on my engineers a lot more to give me the gaps and try to find where I could find time, also with my settings as I was moving them up and down, really trying to find extra time."

Despite the rivalry between the duo - and there was undoubted tension in the green room before they went on the podium as barely a word was exchanged between them - Hamilton insists they can remain friends.

"We've been racing together for a long time, so I don't see why not," said Hamilton.

As for Rosberg, he concurred, although his body language perhaps said different as he commented: "Definitely yes, because we've been through this before.

"It's not the first time, and even back then we had discussions, debate, but always....life goes on. You discuss it and life goes on."

Rosberg is determined Hamilton will not make it five wins in a row in Monaco, a race the former won from pole last year.

"Second place, I'm still close in the championship and with many more races to go," said Rosberg.

"I'll be heading to Monaco where I'll put in a massive effort to go one better, to repeat the win from last year."

As for Ricciardo's team-mate Sebastian Vettel, the reigning four-times champion conjured his best drive of the season to put behind him a torrid weekend hit by gremlins, finishing fourth after starting 15th.

Williams' Valtteri Bottas was fifth, whilst Ferrari, winners here last year with Fernando Alonso, had to settle for sixth and seventh, with Kimi Raikkonen passed by the Spaniard just over two laps from home.

Romain Grosjean hauled Lotus into the points for the first time in a problematic campaign with eighth, with Force India duo Sergio Perez and Nico Hulkenberg ninth and 10th.

That left McLaren out of the points for the third successive race, with Jenson Button and Kevin Magnussen 11th and 12th, respectively, and Max Chilton was 19th in his Marussia.