An international rights monitor has reported the discovery of an execution site in the Iraqi city of Mosul, and given warning of a resurgence of violence if no one is held to account over the murder and torture of Iraqis in the battle against ISIL.

Human Rights Watch's report, published on Wednesday, adds to growing accounts of extrajudicial killings, torture and unlawful detention by Iraqi forces in the final phase of the battle to retake west Mosul from ISIL, or the Islamic State of Iraq and the Levant group.

It details the discovery of the corpses of 17 men, executed in an empty building in west Mosul, on July 17.

Sarah Leah Whitson, HRW's Middle East director, urged Haider al-Abadi, Iraq's prime minister, to investigate and punish those responsible, warning that his victory over ISIL, also known as ISIS, would be short-lived if abuses go unpunished.

READ MORE: Mosul in ruins - 'I see only despair around us'

Abadi formally declared victory over ISIL in Mosul on July 10.

"As Prime Minister Abadi enjoys victory in Mosul, he is ignoring the flood of evidence of his soldiers' committing vicious war crimes in the very city he's promised to liberate," Whitson said.

"Abadi's victory will collapse unless he takes concrete steps to end the grotesque abuses by his own security forces."

Revenge killings

The HRW report cited witness accounts from international observers in Mosul, who it said had provided reliable information in the past.

In the discovery of the execution site on July 17, observers reported seeing a row of 17 male corpses, barefoot but in civilian dress, surrounded by pools of blood, in an empty building west of Mosul's Old City.

A shopkeeper who led the observers there told them he had seen the Iraqi Security Forces 16th division in the neighbourhood four days earlier, and had heard multiple gunshots coming from the area.

He found the bodies the next morning when the security forces left.

Many appeared to have been blindfolded with their hands tied behind their backs.

They lay in positions that suggested they were shot there and had not been moved.

The observers shared with the HRW five photos they took of the bodies.

Other observers told the HRW of Iraqi soldiers showing them videos of killings and beatings.

One observer said a soldier showed them a video on July 11 of himself and other soldiers brutally beating an ISIL suspect, and a second video of the suspect dead, with a bullet to his head.

"Some Iraqi soldiers seem to have so little fear that they will face any consequence for murdering and torturing suspects in Mosul that they are freely sharing evidence of what look like very cruel exploits in videos and photographs," Whitson said.

"Excusing such celebratory revenge killings will haunt Iraq for generations to come."

The HRW has previously documented Iraqi soldiers beating a detainee, then throwing him off a cliff and shooting at his body as it lay at the bottom of the cliff.

OPINION: The battle for Mosul is almost over. What next?

The HRW said it has raised concerns about allegations of ill-treatment, torture, and executions in meetings with Iraqi officials in Baghdad as well as with representatives from the US-led coalition.

However, the group said it "does not know of a single transparent investigation into abuses by Iraqi armed forces, any instances of commanders being held accountable for abuse, or any victims of abuse receiving compensation".

It also urged the Iraqi military to allow journalists access to west Mosul, noting the area has been closed to the media since July 10.

Amnesty International, in a July 11 report, said all sides in the conflict appear to have committed war crimes, causing a "civilian catastrophe" in Mosul.