A lawyer representing about 600 prisoners held at the US military base in Cuba has accused the government of creating a "lawless enclave".
About 600 detainees are being held in Guantanamo Bay
John Gibbons was addressing the US Supreme Court which is considering whether the detainees can have recourse to US civilian courts.
But his opponent told the Court US law did not apply at the Guantanamo base.
The court's ruling due in June could have a major impact on President Bush's declared war on terror, analysts say.
And the judges questioning the two men appeared evenly divided, correspondents say.
The Supreme Court is focusing on the limited issue of jurisdiction - whether a foreign-born prisoner, held outside US borders, can be tried in US courts.
In what turned out to be an intense exchange, John Gibbons said "it's been plain for 215 years" that people in federal detention may file petitions in US courts.
But US Solicitor General Theodore Olson defended the Bush administration's controversial policy - beginning his arguments with "The United States is at war".
Mr Olson said that Cuba, under the terms of a lease with the US concerning the base, had ultimate sovereignty - which meant that the detainees were beyond the control of US courts.
Chief Justice William Rehnquist agreed - but the defence attorney could not accept the argument.
"It is so totally artificial to say that because of this provision in your lease the executive branch can create a no-law zone where it is not accountable to any judiciary anywhere," Mr Gibbons said.
Gibbons wants the executive to be accountable
"This is one of the most important cases that the court has faced in years, because the position that the executive branch was taking is truly extreme."
Legal experts say this is the most significant national security issue to reach the Supreme Court in years.
The case also has larger ramifications, cutting to the heart of questions about executive power in times of crisis, says the BBC's Ian Pannell in Washington.