A British inquiry set up to probe allegations of atrocities carried out by UK troops in Iraq in 2004 cleared them of the most serious claims but found they had mistreated nine detainees.

The report said that some of the soldiers had used "tactical questioning" techniques including food and sleep deprivation on their prisoners in violation of the Geneva Convention.

But it ruled that allegations of murder and torture made by the detainees and their lawyers were the product of "deliberate lies, reckless speculation and ingrained hostility".

The Al-Sweady Inquiry was set up in the aftermath of a notorious firefight near the town of Majar al-Kabir, southwest Iraq, that came to be known as the "Battle of Danny Boy" after the name of a nearby checkpoint.

Troops had been accused of unlawfully killing 20 or more Iraqis at Camp Abu Naji near Majar-al-Kabir in May 2004 after they were taken prisoner following the battle, which was triggered when Iraqi insurgents mounted an ambush.

But former judge Thayne Forbes, who led the inquiry named after one of the dead men, 19-year-old Hamid Al-Sweady, found that they were killed in battle.

British defence minister Michael Fallon apologised for "instances of ill-treatment" but said the "vast majority" of the allegations had been proved false.

The report "puts to rest once and for all these shocking and as we now know completely baseless allegations," he told parliament.

"British soldiers did not carry out the atrocities that had been falsely attributed to them," he said, calling for "an unequivocal apology" from lawyers acting for the claimants.

In March 2013, Forbes began hearing the nearly 300 witnesses who testified. Fallon said the probe cost £31 million (39 million euros, $49 million).

"This was a shameful attempt to use our legal system to attack and falsely impugn our armed forces," Fallon said.

In his report, however, Forbes said the treatment of nine detainees who had taken part in the battle "amounted to actual or possible ill-treatment".

He said several detainees had felt "greatly humiliated and demeaned" by having to strip fully when detained and pointed to cases of medical neglect.

One prisoner with gunshot and shrapnel wounds was denied treatment, it said.

The report made nine recommendations to parliament including a reform of record-keeping for prisoners captured in battle.

Fallon promised "urgent work" on implementing them.

Lawyers for the claimants had already admitted there was "insufficient material" to assert that Iraqi civilians were unlawfully killed in custody but said there were "numerous allegations of violent and other ill-treatment".