Sepang: Ferrari's Fernando Alonso scored a dramatic victory in the Malaysian Grand Prix on Sunday when the Spaniard denied Sauber's Sergio Perez a first Formula One victory in a race turned on its head by the weather.

The race started in torrential rain and was red flagged for 51 minutes after eight laps but Alonso drove a brilliant race in a car that has been outpaced in qualifying in the opening two rounds to register his 28th career victory.

Pole sitter Lewis Hamilton repeated his third place finish from the opening race of the season in Melbourne last weekend, with Red Bull's Mark Webber in fourth and 2007 world champion Kimi Raikkonen fifth in his Lotus.

Australia race winner Jenson Button and world champion Sebastian Vettel both suffered mid-race collisions with the HRT of Narain Karthikeyan and finished outside the points.

Alonso started the race in eighth place but worked his way up to fifth by the red flag and capitalised on a well-timed first pit stop after the resumption to get past the cars ahead of him.

Mexico's Perez closed to within a second of the Ferrari in the latter stages of the race and was on course to secure an unlikely victory but he ran wide on turn 13 with four laps remaining and had to settle for second.