PARIS — The United Nations’ highest court on Monday told Britain that it should end its control “as rapidly as possible” over a remote colonial outpost in the Indian Ocean, best known for housing a strategic American air base on the island of Diego Garcia.

The judges of the International Court of Justice in The Hague voted 13 to 1 that Britain acted unlawfully in 1965 by detaching the Chagos Archipelago from Mauritius, at the time a British colony, in order to pave the way for military installations to be leased to the United States.

The court heard testimony that negotiations between the United States and Britain about building a base began in 1964, a year before the Chagos Islands, which include Diego Garcia, were detached from Mauritius and made a new colony, named the British Indian Ocean Territory.

Officials from Mauritius, now an independent nation, said they were elated that the country’s claims were being recognized.