Lawyers for British and Australian captives being held by the US in Guantanamo Bay challenged the legality of their detention yesterday and demanded access to their clients in a petition to a federal court in Washington.

Lawyers for Asif Iqbal and Shafiq Rasul, both from Tipton in the West Midlands, and David Hicks, from Adelaide, presented a writ of habeas corpus in the first major legal challenge to the indefinite detention of Taliban and al-Qaida suspects at the US military base in Cuba.

The petition challenges the constitutionality of President Bush's executive order permitting the detentions, and it accuses the president, the defence secretary, Donald Rumsfeld and senior officers at the base of denying the detainees the right to a lawyer.

A spokesman for the US attorney's office in Washington said it was unclear how long it would take the court to issue a ruling. He added that the government could be given a fixed period of weeks or months to respond.

Clive Stafford Smith, representing Mr Iqbal and Mr Rasul, said there was no evidence that his clients had set out to wage war against the US, and demanded that they be given due process and a trial.

He contrasted their treatment to the handling of the alleged American Taliban member, John Lindh, who is facing trial in Virginia.

"We all know that John Walker Lindh is going to receive a full trial, a fair trial in the United States and we're merely asking that citizens of the United States's closest ally, Great Britain, receive the same treatment," Mr Stafford Smith told journalists on the steps of the US district court for the District of Columbia.

He said that a third British detainee, Feroz Abbasi, had asked to have his name added to the petition, and that two other British captives who arrived in Guantanamo Bay last week, Ruhal Ahmed and Jamal Udeen, would be welcome to join the action.

Under international pressure, the White House declared earlier this month that Taliban suspects captured in Afghanistan and held at Guantanamo Bay would be treated in compliance with Geneva conventions on war captives. They would not, however, be given the status and rights of formal prisoners of war. President Bush ruled that the Geneva conventions did not apply to al-Qaida captives.

About 300 detainees are now being held in a makeshift open-air jail, known as Camp X-Ray, at Guantanamo Bay where they are being inter rogated by US military intelligence. There are Red Cross workers in the camp, but the captives have been denied access to lawyers. Most are expected to face military tribunals.

Mr Stafford Smith said: "We're all aware that in this country we criticise Fidel Castro for ignoring human rights, for ignoring due process, and it is perhaps a little bit hypocritical that we take people to Guantanamo Bay, a US military base in Cuba, so we can perhaps try to deny rights and due process to people there."

Joseph Margulies, the lawyer representing Mr Hicks, said: "We distinguish ourselves from terrorists only by our commitment to the rule of law, and the law is perfectly clear that the president can't order a person locked up indefinitely, without legal process."

The lawyers challenged arguments that their clients did not qualify for full rights under US law because they were foreign citizens, captured in a war zone, and being held on territory that is not formally part of the United States.

Mr Stafford Smith said: "Any argument that people in Guantanamo Bay have no constitutional rights is an argument that you can take a gun out and shoot them there. "We all know that would be intolerable and I don't think this country would stand for it."