A seven-year-old child who was playing with a lighter inadvertently set fire to the car he was in as the mother was filling up at a petrol station.

A video clip of this incident, which has gone viral on Facebook, showed the mother pumping fuel at a petrol station when the car suddenly burst into flames from within.

The startled mother quickly backed off from the flames and tried to get her child out from another car door but found it to be locked.

She then ran back to the other door and got the child out through the flames as others at the petrol station scrambled to put out the fire.

The video was uploaded by teacher Mastura Ghazali Masra who said the incident involved a Year One pupil in Kuala Krai.

"Saifuddin is now in Kota Baru Hospital because he was involved in a fire while his mother was filing up on petrol.

"The pupil had ignited a lighter," she said in a Facebook posting.

Mastura advised parents to be careful with their children and ensure that lighters are not left in the car.