Britain said that the operation of Diego Garcia, a strategic military base jointly operated with the United States, was protected by the agreement, which also allows Mauritius to resettle the rest of the islands after its population was displaced.
"This government inherited a situation where the long-term, secure operation of the Diego Garcia military base was under threat, with contested sovereignty and ongoing legal challenges," British Foreign Minister David Lammy said in a statement.
"Today’s agreement secures this vital military base for the future. It will strengthen our role in safeguarding global security, shut down any possibility of the Indian Ocean being used as a dangerous illegal migration route to the UK, as well as guaranteeing our long-term relationship with Mauritius."
Britain, which has controlled the region since 1814, detached the Chagos Islands in 1965 from Mauritius - a former colony that became independent three years later - to create the British Indian Ocean Territory.
In the early 1970s, it evicted almost 2,000 residents to Mauritius and the Seychelles to make way for an airbase on the largest island, Diego Garcia, which it had leased to the United States in 1966.
The World Court said in 2019 that Britain should give up control of the islands and said it had wrongfully forced the population to leave in the 1970s to make way for a U.S. air base.
In a joint statement, Britain and Mauritius said that the political agreement had the support and assistance of the United States and India.
(Reporting by Alistair Smout, William James, Muvija M and Michael Holden; Editing by Kate Holton)

A group of Chagossians chant slogans as they attend a mass hosted by Pope Francis at the Monument of Mary Queen of Peace in Port Louis, Mauritius, 09 September 2019. A group of Chagossian people attended a mass hoping that Pope's presence will shed lights on their issues. Sabrina Jean, a chairperson of the Chagos Refugees Group UK, says they want rights to be able to return to their native Chagos island permanently. Mauritius and United Kingdom have been disputing over the sovereignty of Chagos Archipelago. Tens of thousands of people attend the mass hosted by the pontiff as he reached the final leg of his three-nation African tour which has taken in Mozambique, Madagascar and Mauritius. EPA-EFE/DAI KUROKAWA