A US jet bomber lifts off from the Diego Garcia base on a mission to Afghanistan in 2001

In a stinging defeat for Britain, the United Nations General Assembly overwhelmingly demanded Wednesday that London cede to Mauritius the British-ruled Chagos Islands, home to an important military base.

The Indian Ocean archipelago has been at the center of a decades-long dispute over Britain's decision to separate it from Mauritius in 1965 and set up a joint military base with the US on Diego Garcia, the largest of the islands.

A total of 116 countries voted in favor of a non-binding resolution presented by African countries that urged Britain to "withdraw its colonial administration" from the Chagos Islands within six months.

Only six countries, including Britain and the United States, voted against the measure in the 193-nation assembly while 56 others abstained, including Canada, France and Germany.

In February, the International Court of Justice handed Mauritius a victory when it said in a legal opinion that Britain had illegally split the islands and should give up control of the Chagos.

After Britain rejected that ruling, Mauritius turned to the United Nations.

The resolution decides that the United Nations and its agencies shall recognize Mauritius's sovereignty over the Chagos Islands and calls on all governments "not to recognize, support or abet the unlawful colonial administration" in the Chagos.

Resolutions adopted by the General Assembly are not legally binding, but they do carry political weight.

- Keeping the world safe -

Taking the UN podium, Britain argued that the dispute was a bilateral matter and stressed that it had opposed the move to seek the ICJ legal opinion.

British Ambassador Karen Pierce said the Diego Garcia military base "plays a vital role in keeping allies and friends -- including Mauritius -- in the region and beyond safe and secure."

The United States has sent fighter jets from Diego Garcia to bomb Afghanistan and Iraq. The facility was used as a CIA interrogation center after the September 11, 2001 attacks.

In 2016, Britain renewed a lease agreement with the United States for the use of Diego Garcia until 2036.

Richard Gowan, UN director for the International Crisis Group, described the vote as "an embarrassing moment for the UK" as Britain seeks to show that it remains an influential global player post-Brexit.

African countries sought to frame the dispute over the Chagos as an issue of decolonization.

Addressing the assembly ahead of the vote, Mauritius Prime Minister Pravind Kumar Jugnauth said UN member-states must send "a clear signal to the world that colonialism can no longer be tolerated."

It was the second time in two years that Britain has had to defend its rule of the Chagos Islands at the United Nations.

In 2017, only 15 countries including Britain and the US voted to oppose a request for the ICJ ruling.