The victory lifted Alonso, who had started 11th on the grid, to the top of the standings with 111 points, 20 clear of Red Bull's Australian Mark Webber, after eight of 20 races.
It was the 29th career win for Alonso, who won his two titles with Renault in 2005 and 2006.
Alonso was helped by the mechanical problems that forced pole starter Sebastian Vettel's Red Bull and the Lotus of Romain Grosjean out of the race, while McLaren's previous championship leader Lewis Hamilton crashed out in the closing laps.
It was still a momentous achievement on a twisty street circuit that had seen three of the past four winners start on pole and nobody win from lower than third place.
"It's maybe the best victory I have had in terms of emotions," Alonso told a news conference after sharing the emotion with fans and being mobbed by photographers.
"Here now, with the European championship of football on, and all the fans, I am feeling very proud to be Spanish at the moment," said Alonso.