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, and is another in a very long line of National Security reasons why Greenland has to be acquired.

Responding, the prime minister's official spokesman said that the US supports the deal and the president explicitly recognised its strength last year. He added that it was also backed by the UK's Five Eyes allies, the other members of which - besides the UK and US - are Canada, Australia, and New Zealand.

Earlier, a UK government spokesperson had stated that it had acted 'because the base on Diego Garcia was under threat after court decisions undermined our position and would have prevented it operating as intended in future'.

Under the deal agreed in May last year, the UK would hand over sovereignty of the islands to Mauritius, while retaining control of the military base on Diego Garcia.

Before signing the deal, the UK offered Trump an effective veto, due to its implications for US security. Allies of the president had criticised the plan, but during a meeting with Sir Keir in the Oval Office last February, Trump said, 'I think we'll be inclined to go along with your country'.

On Tuesday, Conservative leader Kemi Badenoch said in a post on X that the prime minister now had 'the chance to change course on Chagos'.

Two British Chagossian women born on Diego Garcia want the right to return to their place of birth, expressing discontent over being excluded from discussions surrounding the deal.