Image copyright EPA Image caption More than half a million Muslims are still believed to live in Myanmar's Rakhine state

Myanmar has responded defiantly to a ruling by the UN's top court ordering measures to prevent the genocide of Rohingya Muslims.

The country's Ministry of Foreign Affairs said it presented a "distorted picture of the situation".

Thousands of Rohingya died and more than 700,000 fled to Bangladesh during an army crackdown in 2017.

The measures imposed by the International Court of Justice (ICJ) are binding and not subject to appeal.

However the ICJ has no way of enforcing them.

The case was lodged by the African Muslim majority nation of The Gambia. The ruling warned that genocidal actions could recur.

Myanmar's Ministry of Foreign Affairs said its own commission, the Independent Commission of Enquiry, found that there had been no genocide in Rakhine state. However it did say that war crimes had occurred, and were being investigated and prosecuted by Myanmar's national criminal justice system.

It also blamed condemnation by "human rights actors" for affecting Myanmar's bilateral relations with some countries.

"This has hampered Myanmar's ability to lay the foundation for sustainable development in Rakhine," it added in a statement.

Myanmar, a predominantly Buddhist state, has always insisted that its military campaign was waged to tackle an extremist threat in Rakhine state.

During her defence statement at the court in The Hague, Myanmar's de-facto leader Aung San Suu Kyi described the violence as an "internal armed conflict" triggered by Rohingya militant attacks on government security posts.

Media playback is unsupported on your device Media caption How did this peace icon end up at a genocide trial?

What did the court say?

The panel of 17 judges at the ICJ on Thursday voted unanimously to order Myanmar to take "all measures within its power" to prevent genocide, which they said the Rohingya remained at serious risk of.

These include the prevention of killing and "causing serious bodily or mental harm" to members of the group, as well as preserving evidence of possible genocide that has already occurred.

Presiding judge Abdulqawi Ahmed Yusuf said Myanmar should report back within four months on how it was implementing the ruling.

Media playback is unsupported on your device Media caption Rohingya refugee: "They killed my family in front of me"

What now for Aung San Suu Kyi?

By Nick Beake, Myanmar correspondent, BBC News

This judgment has surely obliterated any remnants of Aung San Suu Kyi's international reputation.

Remember, she didn't have to go to The Hague and become the embodiment of Myanmar's defence. She chose to argue, in person, there was no mass murder, rape or arson.

Even her biggest critics used to acknowledge she doesn't control the still powerful Burmese army, but now she has destroyed the firewall between her and the generals by trying - and failing - to justify their actions.

So far, Myanmar has played by the rules of the International Court of Justice. But will it abide by these emergency measures?

What has been the reaction?

Rohingya groups have welcomed the decision.

"Today's ruling by the ICJ is a crucial moment for Rohingya justice, and vindication for those of us who have lived through this genocide for decades," tweeted Tun Khin, president of the Burmese Rohingya Organisation UK.

"The court's decision clearly shows that it takes the allegations of genocide seriously, and that Myanmar's hollow attempts to deny these have fallen on deaf ears."

Human rights organisation Amnesty International said the decision sent a message that the world would not tolerate Myanmar's "atrocities".

Gambian Justice Minister Abubacarr Tambadou, who led the prosecution, said he was "very, very pleased".

Media playback is unsupported on your device Media caption The BBC saw the remains of burned villages on a tightly controlled government trip to Rakhine state

But some Burmese people responding to a BBC Facebook live broadcast were scathing of the court and its judges.

"This is not a fair and just ruling. I would like to speak on behalf of the Myanmar people that those judges are blind. They are deaf. They do not know the real situation in the country," said Nu Yimwin.

Kyaw Myint Oo described the ruling as a tragic day for the country: "Our situation is like being a prey gradually strangled by a python and eventually we will be forced to give in to all their demands."

Bangladesh Foreign Minister AK Abdul Momen said: "We hope good sense will prevail in Myanmar and they will take back all the Rohingya refugees and provide them security."

What is the background to the case?

The Rohingya, who numbered about one million in Myanmar at the start of 2017, are one of the many ethnic minorities in the country. Rohingya Muslims are the largest community of Muslims in Myanmar, with the majority living in Rakhine state.

But Myanmar's government denies them citizenship, refusing to recognise them as a people and seeing them as illegal immigrants from Bangladesh.

Waves of Rohingya refugees have fled Myanmar for Bangladesh over the decades but their latest exodus began on 25 August 2017 after militants from a Rohingya insurgent group called Arsa launched deadly attacks on more than 30 police posts.

Rohingyas arriving in Bangladesh said they had fled after troops, backed by local Buddhist mobs, responded by burning their villages and attacking and killing civilians.

The government claims that "clearance operations" against the militants ended on 5 September 2017, but analysis of satellite imagery by Human Rights Watch suggests hundreds of villages were destroyed after August that year.