Barcelona, Spain (SportsNetwork.com) - Nico Rosberg gained ground on his Mercedes teammate, Lewis Hamilton, in the Formula One world championship standings by winning Sunday's Spanish Grand Prix.

Rosberg started on pole and had a superb performance in this 66-lap race at the Barcelona-Catalunya circuit. The German pitted just two times compared to three stops for Hamilton. He crossed the finish line 17.5 seconds ahead of Hamilton for his first victory of the season and the ninth of his F1 career.

With the win, Rosberg trimmed Hamilton's lead in the standings from 27 points to 20. Hamilton, the two-time and defending world champion, won three of the first four races this season, including the previous two -- China and Bahrain.

"We had a perfect weekend here in Spain," Rosberg said. "My start was great for the first time this season. From there, I was able to control the pace, and I never felt in danger throughout the whole race. I'm so happy about this win. It's still early days in the season, so it's good to close the points gap to Lewis."

It was the first time Rosberg won the Spanish GP in 10 starts. Hamilton scored the victory in this race last year.

Hamilton started second, but Sebastian Vettel from Ferrari overtook him for the position on the opening lap. Hamilton reclaimed second following a late- race round of pit stops.

"I got off to a poor start with too much wheel spin and had to fight hard just to keep third," Hamilton said. "From there, it was always going to be tough as it's difficult to run right behind another car here and even tougher to pass. I managed to stay close enough to (Vettel) before the first stops, but unfortunately we lost a bit of time there. In the end, we went for a three- stop strategy to try something different."

Vettel ended up finishing third, 45 seconds behind Rosberg. The four-time titleholder is now 31 points in back of Hamilton.

Valtteri Bottas from Williams placed fourth, while Vettel's teammate, Kimi Raikkonen, was fifth and Bottas' teammate, Felipe Massa, sixth.

Toro Rosso's Carlos Sainz, a rookie this season, was the highest-finishing Spaniard in this race with a ninth-place run.

Spaniard Fernando Alonso was the first driver to retire on lap 27 when he experienced a braking issue with his McLaren. While pitting, Alonso went way too deep in his pit box and nearly ran over one of his crew members, the front jack man.

The next F1 race is the Monaco Grand Prix on May 24. Rosberg has won that prestigious event the past two years.