A 3.5-million-litre petrol tank leak has been contained at an oil refinery surrounded by wetlands in Melbourne.

The massive Mobil tank at Altona, in Melbourne's west, began leaking just before midnight last night, setting off an alarm that alerted the Metropolitan Fire Brigade.

MFB spokeswoman Christina Bucci said the petrol was trapped within a walled area and Mobil staff were in the process of draining the petrol into another tank.

The petrol has not got into any drains and air quality has not been affected.

"We would just like to reassure residents in the area that all is safe and the situation is under control," Ms Bucci said.

Draining of the petrol is expected to be completed this morning.

Mobil and the MFB will then clean the area.

The refinery is surrounded by wetlands.

Kororoit Creek, which flows directly into Port Phillip Bay, is on the refinery's southern boundary. There is no housing near the refinery.