Two former Guantanamo Bay prisoners are suing former U.S. defence secretary Donald Rumsfeld and other military officials, accusing them of mistreating and imprisoning them for years despite knowing they weren't enemy combatants.

The men joined three other Guantanamo Bay detainees in a U.S. federal lawsuit late Wednesday against Rumsfeld, former chairman of the joint chiefs of staff Richard Myers and several officials at the military prison.

Like other such lawsuits pending in the Washington federal court, the complaint accuses the government of torturing detainees. Military officials kicked and beat prisoners, suspended them from ceilings, humiliated them and desecrated their Qur'ans, the lawsuit contends.

What is unique about this case, however, is two of the detainees — identified as Abu Muhammad and Zakirjan Hasam — say they went through the military's Combatant Status Review Tribunals and were ruled not to be enemy combatants. Despite that, they said, their mistreatment continued for nearly two years before they were released.

Rumsfeld's successor, Robert Gates, pushed in his first weeks as defence secretary for closing the detention centre at the U.S. naval base in Cuba, arguing its image was so tainted any military trials there would be viewed as illegitimate, the New York Times reported.

He was overruled, however, after U.S. Attorney General Alberto Gonzales and other government lawyers objected to moving detainees to the United States, the Times said in a report posted on its website Thursday night. U.S. Secretary of State Condoleezza Rice agreed with Gates but Vice-President Dick Cheney's office took the same position as Gonzales, the report said, citing unidentified senior administration officials.

Both Muhammad, an Algerian, and Hasam, a native of Uzbekistan, now live in a refugee camp in Albania, the lawsuit said. Both men filed the lawsuits under the pseudonyms they have used since being released.

The Center for Constitutional Rights, a group providing legal services for the men, said the military violated the men's constitutional and human rights.

"Defendants failed in their command obligation to prevent these abuses and investigate and punish those responsible," lawyers wrote.

The Pentagon has said it thoroughly investigated allegations of misconduct at Guantanamo Bay and disciplined officials when appropriate.

The lawsuit faces an uphill battle. A U.S. federal appeals court recently agreed with the Justice Department, which says foreigners held at Guantanamo Bay have no constitutional rights.

Also, government officials are normally immune from lawsuits filed in connection with their jobs. A federal judge is considering whether that immunity is valid in a similar case involving allegations of torture at the Abu Ghraib prison in Iraq.