THE UK’s ambassador in Iran has been summoned to explain his “illegal and inappropriate presence” at an anti-government protest, the Iranian foreign ministry has said.

Rob Macaire was called in to the Ministry of Foreign Affairs after being arrested by police on Saturday as demonstrations broke out in Tehran over the downing of a Ukrainian airliner by Iranian forces, killing all 176 people on board.

The move threatened to further escalate the diplomatic row between London and Tehran after Foreign Secretary Dominic Raab denounced Macaire’s detention as a “flagrant violation” of international law.

READ MORE: These are the profound implications of the killing of Qasem Soleimani

Dozens of Iranian hardliners were reported to have gathered outside the British embassy, chanting “death to England” and calling for the ambassador to be expelled.

It came as large protests erupted in Tehran over days of denials from the regime over the Revolutionary Guard accidentally shooting down the Ukranian plane.

Videos posted online showed protesters shouting anti-government slogans and moving through rail stations and pavements in Tehran, many near Azadi, or Freedom Square after an earlier call for people to demonstrate there.

Other videos suggested similar protests were taking place in other Iranian cities.

Earlier, Macaire denied he had been taking part in anti-government demonstrations. He said he had been attending a vigil for the victims of Flight PS752 when protests broke out and he left. “Can confirm I wasn’t taking part in any demonstrations! Went to an event advertised as a vigil for victims of PS752 tragedy,” he tweeted.

“Normal to want to pay respects – some of victims were British. I left after five minutes, when some started chanting.”

Macaire said that he was arrested 30 minutes after leaving the area, although he was later released.

The Ministry of Foreign Affairs later said on its Telegram channel that he had been summoned over his “illegal and inappropriate presence” at the protests.

The Foreign Office confirmed that Macaire had been called in.

READ MORE: Scottish anti-war protesters turn out to make plea for peace

Raab commented: “The arrest of our ambassador in Tehran without grounds or explanation is a flagrant violation of international law.

“The Iranian government is at a cross-roads moment. It can continue its march towards pariah status with all the political and economic isolation that entails, or take steps to de-escalate tensions and engage in a diplomatic path forwards.”

He was said to have protested strongly that his detention had been unjustified and that it was “completely untrue” to say he had been involved in the protests.

Iran’s deputy foreign minister Seyed Abbas Araghchi said police had been unaware Macaire was a diplomat when he was held as an “unknown foreigner”. He said once he was able to speak to Macaire and confirm that he was the ambassador, he was released within 15 minutes.