Families expelled from the Chagos Islands by the British have won their legal battle for the right to return home at the Court of Appeal
Some 2,000 residents were forced out when the British colony in the Indian Ocean was leased to the US in the 1960s to build an airbase at Diego Garcia.
The government took the case to the Court of Appeal after two earlier rulings declared the actions unlawful.
It has a month to decide whether to appeal to the House of Lords.
Many former residents of the Chagos Islands now live in Mauritius or in the UK.
They were evicted from their homes on the Chagos archipelago between Africa and Indonesia, in the late 1960s and early 1970s.
Lord Justice Sedley, giving the lead ruling, said the government's use of the Order in Council under the Royal Prerogative - powers that allow action without reference to Parliament - was an unlawful way of preventing the islanders from returning.
Lord Justice Waller said the decision had been taken by a government minister "acting without any constraint".
The UK Chagos Support Association welcomed the court's decision and also urged the government not to appeal again.
Chairman Robert Bain said: "The government knows the Chagossians have no independent means to resettle the islands.
"To accept the islanders' right to return but do nothing about it - as it did between 2000 and 2004 - would be meaningless and immoral."
The Diego Garcia base, which was crucial during the Cold War, has gained new significance in recent years as a launching point for bombing missions in Iraq and Afghanistan.
In 2000, the courts ruled that Chagossians could return to their homes in 65 of the islands, but not to Diego Garcia. The then Foreign Secretary, Robin Cook, said the government would not appeal.
But in 2004 the government used the royal prerogative to effectively nullify the decision.
Last year the High Court overturned the order and rejected government argument that the royal prerogative, exercised by ministers in the Queen's name, was immune from scrutiny.
The government took the case to the Court of Appeal, saying the High Court ruling seriously affects the government's control over security matters and its legal relationship with overseas territories.
Will Chagos Islanders' Return Mean Problems for U.S. Base?
UK Government broke law over Chagos exiles