The carpark at Holland Village Market & Food Centre in Singapore, where the drama occurred. Photo: Google Maps

A three-month-old baby girl in Singapore became trapped in the back of a BMW sedan in the sun after the family maid accidentally closed the only open door and set off the auto-lock function.

The family parked the white BMW, which they had taken for a test drive, in a carpark near Holland Village Market & Food Centre at 11.50am. The parents left their keys in the car along with the maid and their three-month-old daughter, Lianhe Zaobao (Singapore) reported.

The maid returned to the carpark with the girl and placed her in the back seat. She put her bag with the car keys on the front seat and began folding the baby’s pram – when the only open door slammed shut.

A florist at the wet market surnamed Huang told a reporter the baby’s parents, who were believed to be in their 30s, were running around shouting for help as their daughter was trapped in the locked car with no air-conditioning.

A locksmith nearby arrived but after examining the car said a specialist was needed to unlock the doors.

The desperate father attempted to break a car window with a bat but wasn’t able to do that. But a florist got a hammer for the father who had to smash the front door window to save his daughter, who had been stuck inside the vehicle for 20 minutes.

The parents were relieved after finding their daughter was all right.

Officers from the Singapore Civil Defence Force arrived at the scene 10 minutes after the girl was rescued. They checked that she was in a safe condition with no visible injuries.