In a race that was stopped for 51 minutes due to rain, Alonso looked like being overtaken by Sauber's Sergio Perez until the Mexican driver ran off the track with six laps to go, giving the Ferrari enough of a gap to win.
The Ferrari team had been considered to be in crisis after a poor start to the season, but a superb display of wet—weather driving gave two—time world champion Alonso a memorable victory. Perez's second place was Sauber's best—ever race finish.
Pole—sitter Lewis Hamilton of McLaren finished third ahead of Red Bull's Mark Webber and Lotus' Kimi Raikkonen.
Williams' Bruno Senna finished sixth in his best F1 finish, Force India's Paul di Resta and Nico Hulkenberg were seventh and ninth, respectively, separated by Toro Rosso's Jules Vergne. Mercedes' Michael Schumacher took the last point for tenth place.
The race finished in gathering gloom at 6-48 p.m. local time (1048 GMT) due to the long delay caused by a tropical downpour that started after just six laps.
Immediately after the restart, there was a flurry of pitstops as drivers changed from full wet to intermediate tires, and Alonso emerged in the lead.
Perez sliced Alonso's lead to just half a second with seven laps to run, but critically ran wide at the final turn onto the back straight, giving the Spaniard enough breathing space to hang on for victory, 2.2 seconds ahead of the Sauber driver.
Sauber had notched six third place finishes in its history, but this was its best result.
World champion Sebastian Vettel of Red Bull was running in fourth place for most of the latter half of the race, but picked up a puncture when he collided with HRT's Narain Karthikeyan with nine laps to go, and finished 11th.
McLaren's Jenson Button also clipped Karthikeyan earlier in the race, dropping him to last before he recovered to 14th.