Iraq is casting a long shadow over the US presidential race, and with relative calm in the country the candidates are debating how fast US troops should quit Iraq. Senator Barack Obama’s 16-month timetable for withdrawal has the backing of Iraqi leaders, and the Bush administration itself now endorses a “time horizon” for troop cuts. But absent from the debate has been any discussion of the fate of nearly 21,000 prisoners held in Iraq by US forces. Obama and his Republican rival Senator John McCain ought to start talking now about what to do with detainees in US military custody in Iraq.

The US-led Multinational Force-Iraq (MNF) has claimed the authority to hold the detainees under successive UN Security Council Resolutions, the last of which expires at the end of the year. Prospects for a status-of-forces agreement (SOFA) and related pacts that might fill the legal void are clouded by the Bush administration’s lame duck status.

The detainees – all Iraqis, save for a small number of foreigners – are effectively denied their basic right not to be held indefinitely without charge or trial. Many are young men rounded up in mass, arbitrary arrests. They are promised a review of their cases every six months, though the MNF has told Human Rights Watch reviews are more frequent in practice. Yet on average, detainees remain in custody for more than 300 days, according to MNF figures as of May. The detainees, divided between a remote prison near Basra and a smaller one near Baghdad’s airport, have little access to relatives, who in many cases cannot afford to visit or fear reprisal. Although about a tenth of detainees face charges in an Iraqi criminal court; the vast majority are never charged.

The MNF has argued that the detainees are held as imperative security threats, and are not entitled to criminal due process. International law does indeed allow for administrative detention, but the United States has not even met the basic requirements for holding people under such circumstances. The cases are reviewed by military panels, with no meaningful access to legal counsel and no judicial review – both of which detainees are entitled to under international law.

There are 360 children among the detainees, down from 500 in May. Many have been held for months, and some for more than a year, often without access to the educational services provided to children at one MNF facility. Those children referred to trial by the MNF are held at an Iraqi facility described by the UN as so overcrowded it threatens the children’s health.

Few would dispute that the conditions of US military detention have improved since the images of shocking abuse that emerged in 2004 from the Abu Ghraib prison. It’s also clear that, however vigorous MNF attempts to expedite detainee releases this population is not going anywhere soon. The outgoing head of US detainee operations estimated in June that 10,000 people had been released through expanded review procedures introduced in September 2007, yet the overall population is only slowly falling from its peak near 26,000 in 2007. Britain, Washington’s principal partner in the invasion of Iraq, has all but ended its role as a jailer in Iraq – Foreign Office officials say UK forces now have two detainees in the country – leaving the US military as the face of foreign military detention in Iraq.

In the wrangle over a bilateral agreement that would govern the presence of US troops in Iraq, the meaning of Iraqi sovereignty looms large. Much of Iraq’s political class rejects the idea of an open-ended US military presence (no easy sell ahead of provincial elections scheduled for this year), advocating a short-term agreement and possible negotiations with the next administration. The Bush administration appears to accept that possibility.

All parties to this debate should back up their rhetoric about Iraqi sovereignty by ending the legal vacuum in which the MNF holds detainees. A step in that direction would be a US-Iraqi agreement to bring the status of these detainees in line with international human rights law and the laws of war for conflicts like the one in Iraq. The International Covenant on Civil and Political Rights, which Iraq has ratified, requires among other things that detainees face a judge promptly, and have prompt access to legal counsel and family members. Such a commitment should encourage the Iraqi authorities to improve their own poor record on detention and abuse of detainees.

The United States should also release at once detainees unlikely to be charged, and transfer others against whom there is evidence for criminal proceedings to Iraqi courts – with the safeguard that no one should be transferred there if they are at risk of abuse.

The US presidential candidates are now jockeying to claim victory for their Iraq plans. Both should commit to ending the legal limbo of detention in Iraq, by upholding international legal standards in Iraq and restoring justice to the thousands wrongly held.

Joseph Logan is the Iraq researcher for Human Rights Watch