QAYYARA, Iraq (Reuters) - The stench hits you long before you reach the morgue where the latest casualties of war between Islamic State militants and Iraqi forces are kept.

An Iraqi boy walks past a building destroyed during the fighting between Iraqi forces and Islamic states militants in Qayyara, Iraq April 6, 2017. Picture taken April 6, 2017. REUTERS/Suhaib Salem

Doctor Mansour Maarouf dons a surgical mask as he approaches the morgue refrigerator and pauses before pulling open the door to an icy blast. “In the name of God,” he says out of respect for the dead.

Inside, around two dozen corpses lie on the floor: some in body bags, several wrapped in blankets and a few so torn to pieces they come in sacks.

Nearly all of them are victims of the ongoing battle to dislodge Islamic State militants from Mosul, around 60 km further north. On the deadliest day so far, 21 bodies arrived at the hospital in the town of Qayyara.

The morgue gives a sense of the heavy toll the conflict is taking on civilians, but also highlights the practical challenges of dealing with the dead when infrastructure is ruined and administration has collapsed.

Staff at the hospital, which is run by aid group Women’s Alliance Health International (WAHA), purchased the cable connecting the morgue fridge to the power supply themselves, and space is limited.

“They (the Iraqi health ministry) have promised to provide us with shelves to increase the capacity,” said the doctor.

Until recently, the only place in the province authorized to issue death certificates was the department of forensic medicine in west Mosul, which remains under Islamic State control.

That meant the dead had to be driven hundreds of kilometers to the cities of Tikrit or Erbil and often got held up at checkpoints on the way, if not turned back.

To resolve the issue, the Iraqi government has now authorized the hospital in Qayyara to issue death certificates, except when the victim’s identity or cause of death are unclear.

In those cases, the body is transferred to a new mortuary on the eastern side of Mosul, which is under the control of Iraqi security forces.

There, an autopsy is conducted if necessary, and the body is buried in a numbered grave so it can be found in future should someone come searching.

“We wait for a period (before burying the body), depending how full the fridges are,” said Dr Modhar Alomary, who is in charge of the morgue, the sound of outgoing artillery in the background.

Alomary declined to say how many bodies he had received.

BRINGING UP THE BODIES

It might seem that Alomary’s workload would decrease once the battle for Mosul is over, but he expects the opposite.

That is when the task will begin of uncovering the mass graves where Islamic State threw its opponents after executing them.

A sinkhole south of Mosul believed to be the largest site may contain as many as 4,000 bodies, according to Human Rights Watch.

One worker at the morgue knows the scale of Islamic State’s two and half year killing spree better than most. He was an employee at the morgue in Mosul when Islamic State overran the city in the summer of 2014 and kept working there until just over one month ago.

In that time, “huge numbers” of bodies passed through the morgue, he said, many of them civilians, former policeman and ex-soldiers killed by the militants. “Sometimes we got 20-25, 50 (bodies in a day).”

The militants, who assumed control of hospitals across Mosul and appointed an “Emir of Health”, did not allow the morgue workers to conduct autopsies on their victims.

As for Islamic State’s own dead, the morgue worker said he was forced to fabricate the cause of death on the certificates of Iraqi fighters slain in battle, such as “car accident”.

That, to him, was an indication the militants anticipated defeat and wanted to make life easier for the families of its Iraqi members after Islamic State.

Death certificates were not issued for foreign fighters because their only identity was a nom de guerre, he said.

During the battle for Mosul’s eastern half, the morgue worker said he had received the corpses of 72 militants in a single day, estimating a total of 2,000 had passed through in the three months it took Iraqi forces to rout them.

Iraqi forces are now struggling to dislodge Islamic State from a few remaining districts in the west of the city, and the morgue worker said comparatively few dead militants had been brought in up until the point he left: “The number of civilian casualties is greater,” he said.

Many civilians killed in Mosul have been buried in gardens by relatives who were not able to reach a graveyard during the fighting and now want to dig up their loved ones and give them a proper burial.

Two men came to ask Dr Alomary what they should do with the remains of several relatives who were among dozens of civilians killed in an air strike by the U.S.-led coalition on the western Mosul Jadida district last month.

“We buried them by the side of the road and want to bring them here,” one of the men said to the doctor, who advised him to wait for Iraqi forces to finish clearing the rest of the city.

The bodies must also be dug up to get an official death certificate, which will enable victims’ relatives to claim compensation from the government.

But unless the authorities keep watch, people could take advantage of the chaos to fake deaths -- whether to escape justice, or simply start a new life.