At least welve prematurely born babies were killed in a fire that broke out in the early hours of Wednesday on a maternity ward in a Baghdad hospital and was probably caused by an electrical fault, Iraqi authorities said.

Eleven or twelve other babies and 29 women were rescued from the Yarmuk hospital's maternity ward and transferred to other hospitals, Hani al-Okabi, an MP who previouly managed a health directorate in Baghdad, told journalists after visiting the hospital and talking to the management.

Firefighters and hospital staff took about three hours to put out the blaze that engulfed the ward, according to one medic. Yarmuk is a main hospital on the western side of the capital, with emergency care facilities among others.

"My son's birth was difficult," Shaima Hussein, one of the babies' mothers, told Reuters news agency at the gate of the hospital. She said she was not given a chance to rescue her newborn.

"I came with milk powder for him, and then this happened ... they shut the electricity and the doors," she said.

READ MORE: Ban militias with abuse records from Mosul fight, says HRW

Hassan Omar said he was upset that the hospital would not give him information about his twins other than that he may have to have DNA checks to see if they were among the dead.

"I went to the other hospital, they are not there, so where are they?" he said.

The incident is likely to intensify public accusations of state corruption and mismanagement.

Pictures posted on social media showed the hospital in a state of neglect, with cockroaches crawling out from between broken tiles, dustbins overflowing with rubbish, dirty toilets and patients lying on stretchers in the courtyard.

The relative of a patient who died recently in the hospital from meningitis said he saw cockroach crawling along the tube of an oxygen mask.

"It was so dirty," he said. "We had to bring our own bed sheets."

Thirteen years after the US-led invasion that toppled Saddam Hussein, the oil-rich country still suffers a shortage of electricity, water, schools and hospitals.

Prime Minister Haider al-Abadi has been trying for more than two years to tackle corruption in Iraq, which ranks 161 out of 168 on Transparency International's Corruption Index, but has faced resistance from much of the political elite.

Corruption has exacerbated the effects on the economy of a sharp decline in oil revenue caused by falling crude prices and the costs of fighting Islamic State in Iraq and Syria (ISIL, also known as ISIS), the hardline group that has controlled large parts of northern and western Iraq since 2014.