The UK government has defended a deal to give the Chagos Islands to Mauritius and lease back a key military base, following criticism from US President Donald Trump over its handling.

In a post on social media, Trump labelled the move as an act of great stupidity and total weakness, months after he and senior US officials endorsed it.

In response, the UK government said it would never compromise on our national security, while the prime minister's official spokesperson insisted the US still supported the move.

The UK signed the £3.4bn ($4.6bn) agreement in May, under which it would retain control of a UK-US military base on the largest of the islands, Diego Garcia.

In a post on his Truth Social platform on Tuesday morning, Trump said: Shockingly, our 'brilliant' NATO Ally, the United Kingdom, is currently planning to give away the Island of Diego Garcia, the site of a vital U.S. Military Base, to Mauritius, and to do so FOR NO REASON WHATSOEVER.

There is no doubt that China and Russia have noticed this act of total weakness. He added: The UK giving away extremely important land is an act of GREAT STUPIDITY...

The prime minister's official spokesman stated that the US supports the deal. Additionally, it was backed by the UK's Five Eyes allies, which include Canada, Australia, and New Zealand.

Earlier, a UK government spokesperson explained that the agreement had secured the operations of the joint US-UK military base for generations, with provisions to keep its unique capabilities intact.

On Tuesday, Conservative leader Kemi Badenoch criticized the prime minister's stance, insisting that paying to surrender the Chagos Islands is not just an act of stupidity, but of complete self-sabotage. Meanwhile, Liberal Democrats leader Sir Ed Davey expressed that Trump's comments reflected a failure in the government's approach to US relations.

Two British Chagossian women, Bernadette Dugasse and Bertrice Pompe, called for greater inclusion in discussions regarding their homeland's future amidst the controversy surrounding the agreement.