(CNN)Nico Rosberg believes he has taken "one step in the right direction" after ending world champion teammate Lewis Hamilton's dominance of qualifying in the 2015 Formula One season.
F1: Nico Rosberg ends Lewis Hamilton's run of pole positions at Spanish GP
Mercedes will have both cars on the front row of the grid for Sunday's Spanish Grand Prix but this time Rosberg will be first as Hamilton failed to secure a fifth successive pole position.
The German clocked one minute and 24.681 seconds to be 0.267s quicker than Hamilton -- and also faster than Hamilton's effort last year in securing the top qualifying spot at the Circuit de Catalunya.
Hamilton won that race -- one of eight times in the past 10 Spanish GPs where the polesitter has triumphed.
"Of course I needed it sooner rather than later," said Rosberg, who is second in the drivers' standings -- 27 points behind Hamilton.
"It is one step in the right direction to winning the race. It was a good day in the office."
Rosberg earned pole in 2013 but finished sixth as Fernando Alonso won the race. The Spaniard is one of eight different winners in the last eight years in Barcelona.
"Strategy is important," Rosberg told reporters. "It's a big advantage to have a new set of used tires for the race. Overtaking is more difficult around here, so starting in front is a big advantage."
Hamilton was just over half a second quicker than Ferrari's Sebastian Vettel, who was 0.236s faster than Williams' fourth-placed Valtteri Bottas.
"Nico did a great job," the English driver said. "I didn't have the balance where I liked. Tomorrow there's still a lot to play for.
"I didn't think I was on the back foot, I just didn't have pace today and didn't do a great job."
Four-time world champion Vettel, who won the 2011 race in Spain when at Red Bull, said he was encouraged by Ferrari's continued strong showing.
"I think it is great for Ferrari to keep confirming how close we are. This is a great race for us -- it is very nearly a home race for us," said the German, referring to the Italian team's Spanish banking sponsor.
Vettel's teammate Kimi Raikkonen, who was second in Bahrain, had less sucess in Saturday's qualifying and will start the race seventh behind Toro Rosso's impressive rookies Carlos Sainz Jnr. and Max Verstappen.
"If we have a good start we can go from there," said the veteran Finn, who won Ferrari's last world title back in 2007. "I'm sure we have the speed to have a good race."
The young Toro Rosso duo once again outperformed their colleagues at senior team Red Bull, with Danil Kvyat qualifying eighth and Daniel Ricciardo 10th, while Williams veteran Felipe Massa was ninth.
Sainz is racing in front of his home fans for the first time, but the 20-year-old played down expectations despite his best qualifying performance so far.
"There is a Ferrari behind that has the best race pace of the whole field and a Williams that has 12 kph more top speed than us, then we have two Red Bulls," said the son of former rally champion Carlos Sainz.
"For the first time in the season, I was waving to the crowd and it felt like a pole position."
McLaren failed to reach Q3, but again showed slight improvement as Alonso -- returning to the track where he crashed heavily in preseason and suffered concussion -- was 13th and fellow world champion Jenson Button was 14th of the 20 drivers. Both were more than three seconds slower than Rosberg.