The first Oscar win for a Muslim actor - Mahershala Ali for Moonlight - was applauded around the world on Sunday night, but caused controversy in Pakistan.

Pakistan’s Permanent Representative to the United Nations Maleeha Lodhi deleted a tweet congratulating Ali, after other Twitter users started pointing out he is an Ahmadi - a member of an Islamic sect often persecuted for identifying as Muslim.

Article 260-3 of Pakistan’s Constitution declares Ahmadis “non-Muslims” and it is practically illegal to be one in the country.

Lodhi taking back her congratulations was fiercely criticised on social media.

“If Mahershala Ali identified as a Muslim in Pakistan, he’d be jailed for three years under the country’s anti-Ahmadi laws,” writer and activist Kashif N. Chaudry wrote.

“In Malaysia, Indonesia and much of the Arab world, he’d have to worship secretly in fear of attacks by mobs or arrest by State, and he’d be denied his right to enjoy religious freedom.

“Hence, it is very relevant to remember his #Ahmadiyya identity, and appreciate what layers of hate he had to cross to be the champ that he is.”

Ali discussed his conversion to Islam (“my ordained minister mother didn’t do backflips”) at the SAG Awards last month.

A first-time Oscar nominee, the 43-year-old beat Dev Patel, Jeff Bridges, Michael Shannon and Lucas Hedges to win the Supporting Actor award at the 89th Academy Awards on Sunday night.