Mr. Shogren said advisers were trying to improve relations between police officers and justice officials. He said police officers routinely disobeyed court orders to release prisoners from station jails or to provide security for investigative judges. Iraq’s investigative judges are fashioned after the French legal model, in which the functions of detective, prosecutor and judge overlap.

“Sometimes judicial investigators complain that police will not escort them, will not provide security, will not cooperate with them,” Mr. Shogren said. “And the Iraqi police, on the other hand, say that judicial investigators are just too afraid or lazy to go out and work the scene.”

The inability of law enforcement officials to investigate crimes in a timely manner is among the main reasons that Iraq’s prisons hold so many people without trial, Mr. Shogren said.

Mike Pannek, the program manager of the Iraq Corrections Program, a Justice Department program, said Justice Ministry prisons were filled beyond their capacity. One of the government’s largest prisons is a temporary installation at the Rusafa legal complex in Baghdad. Mr. Pannek said that nearly all of the 6,647 detainees at Rusafa had been captured since the American force was increased early last year, and that 6,079 of them had not been found guilty of any crime.

Thousands more prisoners are held by other agencies, despite findings in 2006 that such disparate detainee systems hindered oversight and led to human rights abuses. In 2006, American troops determined that several Interior Ministry jails were being used by Shiite militias to torture and execute Sunni prisoners. Interior Ministry officials promised to transfer all their prisoners to Justice Ministry facilities.

But Mr. Pannek said that both the Interior and Defense Ministries held significant numbers of detainees, and that the numbers had grown.

Mr. Pannek estimated that Iraq needed space for 50,000 prisoners, and said there were plans to provide about 20,000 more prison beds over the next year.