Ayatollah Khamenei tweeted a picture of a child grieving over the body of a man killed in the violence.

Iran's supreme leader Ayatollah Khamenei said the Indian government "should confront extremist Hindus" and "stop the massacre of Muslims" in a sharply-worded tweet on Thursday referring to last week's violence in northeast Delhi in which 53 were killed.

"The hearts of Muslims all over the world are grieving over the massacre of Muslims in India. The government of India should confront extremist Hindus and their parties and stop the massacre of Muslims in order to prevent India's isolation from the world of Islam," Khamenei tweeted, with the hashtag #IndianMuslimslnDanger.

The hearts of Muslims all over the world are grieving over the massacre of Muslims in India. The govt of India should confront extremist Hindus & their parties & stop the massacre of Muslims in order to prevent India's isolation from the world of Islam.#IndianMuslimslnDanger — Khamenei.ir (@khamenei_ir) March 5, 2020

Khamenei, who controls all major security and foreign policy decisions, tweeted in English, Urdu, Persian and Arabic along with a photograph of a child grieving over the body of a man killed in the violence.

India had registered its strong protest earlier this week over comments by Iran Foreign Minister Javad Zarif, calling them "unwarranted". Iranian ambassador Ali Chegeni was summoned and told that the minister's comment was on matters purely internal to India, said sources.

Mr Zarif had said in a tweet: "Iran condemns the wave of organised violence against Indian Muslims. For centuries, Iran has been a friend of India. We urge Indian authorities to ensure the well-being of ALL Indians and not let senseless thuggery prevail. Path forward lies in peaceful dialogue and rule of law."

What stood out in the tweet was the use of the word "condemns", given that India, despite occasional pressures over the need to balance ties with the US, has traditionally had good relations with Iran, rooted in long-standing historical and cultural ties. India has also been actively involved in the development of the strategically located Chabahar port in the Gulf nation.

Mr Zarif even visited India in January as tension peaked with the US over the killing of top Iranian General Qassem Sulemani in a military strike in Iraq.

Last week, Indonesia, the world's largest Muslim country, had summoned the Indian ambassador to express concern about the violence. The Indonesian government had said it had "complete confidence that the government of India will be able to manage the situation and ensure the harmonious relations among its religious communities".

Raveesh Kumar, the Ministry of External Affairs spokesperson, had urged international leaders and bodies to not make irresponsible statements during what he called sensitive times.

The Delhi violence erupted in the middle of a two-day visit by US President Donald Trump, who, at one point, was only 15 km from the rioting. Asked on the violence in another part of Delhi, Mr Trump said he did not discuss individual attacks with Prime Minister Narendra Modi and that these were "up to India".

Mr Trump said he did speak to PM Modi on religious freedom in the country and that the Prime Minister told him "he wants people to have religious freedom".

The violence began as clashes between rival groups over the controversial Citizenship Amendment Act, or CAA. For four days, mobs armed with sticks and stones burnt shops, schools and homes and terrorised neighbourhoods until the police finally managed to get things under control.

According to the CAA, non-Muslim minorities from Pakistan, Bangladesh and Afghanistan can become Indian citizens easily if they fled due to religious persecution and entered India before 2015.