UK should end its control of the Chagos Islands in the Indian Ocean as rapidly as possible, the UN's highest court has said. Mauritius claims it was forced to give up the islands - now a British overseas territory - in 1965 in exchange for independence, which it gained in 1968.
The International Court of Justice said the islands were not lawfully separated from the former colony of Mauritius.
The UK Foreign Office said: This is an advisory opinion, not a judgment. It added it would look carefully at the detail of the opinion, which is not legally binding.
The UK has previously said it will hand the islands back to Mauritius when they are no longer required for defense purposes.
Referencing that, the Foreign Office said: The defense facilities on the British Indian Ocean Territory help to protect people here in Britain and around the world from terrorist threats, organized crime and piracy.
Judge Abdulqawi Ahmed Yusuf described the UK's administration of the Chagos Islands - located more than 2,000 miles off the east coast of Africa - as an unlawful act of continuing character.
He added the UK was under an obligation to bring an end to its administration of the Chagos Archipelago as rapidly as possible.
The UN General Assembly asked the court in February 2017 to offer its opinion in on whether the process had been concluded lawfully.
It is half a century since the UK took control of the Chagos Islands from its then colony, Mauritius. The British government evicted the entire population, before inviting the US to build a military base on Diego Garcia, one of the larger atolls.
Mauritius was in the middle of negotiating its independence from the UK at the time and has repeatedly condemned the deal.
Some of those who were forced to leave their homes on the Chagos Islands in the late 1960s hoped they would be allowed to return - and not just on one of the rare visits authorized by the UK.
Speaking to the BBC last year, Samynaden Rosemond, who left when he was 36, said: Back home was paradise. He and his wife, Daryela, moved to the outskirts of the capital of Mauritius, Port Louis.
Chagossians often complain that they are treated as second-class citizens in Mauritius, and they often gather to cook coconut and fish curry and to sing songs about the life they left behind.
Mr Rosemond added: The British didn't give us a chance. They just said: 'Oh, this is not yours anymore.' If I die here my spirit will be everywhere - it wouldn't be happy. But if I die there I will be in peace.
Several Chagossians gathered at the Chagos Refugee Group's centre to follow live the session of the International Court of Justice in The Hague.
It was in an explosion of joy that the news was celebrated by both them and their descendants in Pointe aux Sables - a suburb of the Mauritian capital, Port Louis.
The leader of the Chagos Refugees Group, Olivier Bancoult, said it was a historic day. I dedicate this victory to the entire Chagossian community that is scattered in several countries around the world, he said.
It is a great victory as all the time we wanted to go gather on the graves of our families that we lost there [on the Chagos Archipelago].
Mauritian Prime Minister Pravind Jugnauth said the UK had always emphasized respect for international laws and, as such, expected the country, with which Mauritius has excellent relations, to respect the judges' opinion.