Rosberg secured pole with his first run on medium tyres in Q3, posting a best time of 1:24.681.
Hamilton, on pole in the first four races of the season, was unable to respond to that and will start from second place.
The Mercedes duo proved to be in a class apart, with Sebastian Vettel third in the Ferrari, but over seven tenths of a second behind Rosberg.
Valtteri Bottas will share the second row of the grid with Vettel after putting the Williams in fourth place.
Toro Rosso driver Carlos Sainz delighted his home crowd with a sensational fifth place, his best ever qualifying result so far.
Teammate Max Verstappen was sixth, as Toro Rosso outpaced sister team Red Bull once again.
Daniil Kvyat will start from eighth, while teammate Daniel Ricciardo qualified tenth, behind the second Williams of Felipe Massa.
For the first time this year, neither Lotus made it into the top ten.
Romain Grosjean was 11th fastest, while teammate Pastor Maldonado will start from 12th.
Despite higher hopes for the first race of the European season, McLaren endured another disappointing day as both its drivers failed to reach Q3.
Local hero Fernando Alonso will start from 13th position, in front of teammate Jenson Button, who complained of brake problems and a general lack of grip.
|Pos||Driver||Car / Engine||Time||Gap|
|5||Carlos Sainz||Toro Rosso/Renault||1’26.136||1.455|
|6||Max Verstappen||Toro Rosso/Renault||1’26.249||1.568|
|8||Daniil Kvyat||Red Bull/Renault||1’26.629||1.948|
|10||Daniel Ricciardo||Red Bull/Renault||1’26.770||2.089|
|17||Nico Hülkenberg||Force India/Mercedes||1’28.365||3.684|
|18||Sergio Pérez||Force India/Mercedes||1’28.442||3.761|