Six Iraqis want an inquiry into allegations surrounding British troops
The Treasury Solicitor and the head of the Royal Military Police have spoken of their "profound and deep regret" over a case involving British troops.
They were giving evidence in proceedings held at the High Court.
They also announced top level reviews into the way government departments release documents to the courts.
Six Iraqis are seeking an independent inquiry into allegations that 20 Iraqis were interrogated and killed after a battle near Basra in Iraq, in May 2004.
Their lawyers argue the High Court should order a new inquiry because Royal Military Police (RMP) investigations into the accusations were flawed and inadequate.
The RMP inquiry rejected the allegations of murder, torture and mutilation.
Crucial to the case is the disclosure of documents relating to the RMP investigations, which concluded that British soldiers had done nothing wrong and the Iraqis had died on the battlefield.
But Lord Justice Scott Baker said the late release of documents held by the RMP to the court and the Iraqi legal team had thrown the hearing into confusion, and described this as a "totally appalling state of affairs".
In an unprecedented move, he summoned senior figures to court to explain what had gone wrong.
Treasury Solicitor Paul Jenkins told the court he had now ordered an extended review into national security cases "to produce clear guidance on how disclosure should be handled in such complex cases".
He told Lord Justice Scott Baker, sitting with Mr Justice Silber and Mr Justice Sweeney: "I am immediately writing to all permanent heads of government departments drawing their attention to this case, reminding them of the rigorous nature and extent of our duties of disclosure and of the profound importance of those duties."
The Provost Marshal of the Royal Military Police Brigadier Eddie Forster-Knight offered the court his "unreserved apology" for "human errors and inadequate process".
He said a lack of resources had resulted in errors and he would be seeking improved computer facilities to help manage large quantities of data.
"I will be raising these issues with the Chief of the General Staff - the professional head of the Army - as a matter of priority," he said.