A baby boy died shortly after his 21-year-old mother gave birth in a toilet at an Australian public hospital.

The mother went to Bankstown Hospital's emergency room in New South Wales complaining of abdominal pain, the Seven Network reported.

Unaware she was pregnant, the woman told doctors she had been diagnosed by two general practitioners with constipation.

Hospital staff arranged for her to have X-rays without testing to see if she was pregnant -- examinations which are dangerous to unborn babies.

A radiologist realized she was pregnant and told her to go back to the emergency department, Opposition health spokesman Jillian Skinner said.

"They didn't tell her she was pregnant,'' Skinner said.

On her way to the emergency department the woman gave birth to the baby in a hospital toilet.

"I understand the nurses spent 45 minutes trying to resuscitate the baby. It's a tragic story,'' Skinner added.

Sydney Southwest Area Health Service issued a statement about the incident.

"A young woman presented to Bankstown Hospital Emergency Department last night unaware she was pregnant,'' a spokesman said.

"She gave birth to a baby that sadly did not survive. These are very unusual and upsetting circumstances for the patient and hospital staff.”

Click here to read more from news.com.au.