Ian Macdonald, one of the Special Advocates authorised by the authorities to work on terrorism-related issues, announced his decision to resign, in the Mail on Sunday newspaper, after a ruling by the Law Lords - a panel of senior judges who act as the ultimate court of appeal in Britain.
The Law Lords ruled 8-1 on Thursday that the detention of nine foreigners under the law breached human rights obligations.
"Such a law is an odious blot on our legal landscape and for reasons of conscience I feel that I must resign," Macdonald wrote in the weekly.
"My role has been altered to provide a false legitimacy to indefinite detention without knowledge of the accusations being made and without any kind of criminal charge or trial."
Up to now Macdonald had stayed on because he thought he could "make a difference", despite considering it "a wrong law brought in the wrong way to the wrong court".
The Independent newspaper said on Monday five lawyers out of the 19 with similar responsibilities would also announce their resignations this week.
"I would be surprised if I was the only one," Macdonald told The Guardian.
Britain's anti-terror laws were
introduced after 9/11
"I support Mr Macdonald's decision and hope he will not be the last," said Natalia Garcia, lawyer for one of the detainees, quoted by The Independent.
The daily said Macdonald would write to his colleagues to encourage them to follow his example.
Introduced after the 11 September 2001 attacks in the United States, the anti-terror law allows foreigners to be jailed indefinitely without trial if the home secretary rules they are suspected of involvement in international terrorism, and they opt not to be deported to their home country.
One member of the nine-strong panel, Lord Leonard Hoffman, warned in an outspoken personal opinion that the real threat to Britain "comes not from terrorism but from laws such as these".
The ruling severely dented one of the centrepieces of Prime Minister Tony Blair's post-September 11 anti-terrorism efforts, and came just a day after Home Secretary David Blunkett resigned over a personal scandal.
"Such a law is an odious blot on our legal landscape and for reasons of conscience I feel that I must resign"
Lawyer Ian Macdonald
Foreign Secretary Jack Straw said on Friday that the landmark judgment was "simply wrong".
Straw said the government would look carefully at the Anti-Terrorism, Crime and Security Act 2001. But he stressed that it was ultimately up to parliament to decide what would happen next and whether the men should stay in jail.
According to rights groups, up to 14 foreign nationals are being held under the 2001 act, although only nine were involved in this test case.
Most are at London's high-security Belmarsh Prison, dubbed by critics as "Britain's Guantanamo Bay", after the controversial US prison for terror suspects in Cuba, but others are being kept in a psychiatric hospital.