The foreign secretary has condemned the arrest of Britain’s ambassador in Iran during anti-government protests as a “flagrant violation of international law” and said the country was marching towards “pariah status”.

Dominic Raab’s strongly worded statement came after the ambassador, Rob Macaire, was arrested on Saturday during demonstrations near Amirkabir University in Tehran for “inciting” the protesters. He was held for more than an hour on suspicion of organising, provoking and directing radical actions before he was released, the Iranian Tasnim news agency said.

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

UK ambassador to Iran denies he joined Tehran street protests Read more

“The Iranian government is at a crossroads 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.”

It is understood that Macaire, a distinguished diplomat with 30 years’ experience, had been attending what had been billed as a vigil for the victims of the crash.

However, the event quickly turned into a demonstration, at which point the ambassador left. It was as he was returning to the British embassy that he was arrested, although it is not clear who he was held by.

After a number of urgent calls to the Iranian ministry of foreign affairs he was eventually released and allowed to return to the embassy.

The new diplomatic row came as Iran’s embattled regime was shaken by a wave of international condemnation and domestic criticism after admitting its forces shot down a Ukrainian passenger plane with 176 people onboard and it had lied in a bid to cover up its role in the tragedy. Facing possibly the biggest crisis since the 1979 Islamic revolution, senior clerical, political and military leaders scrambled to contain the fallout from what President Hassan Rouhani termed a “disastrous mistake”.

But the latest crisis, coming close on the heels of Donald Trump’s assassination of a senior leader, Gen Qassem Suleimani, military clashes with the US in Iraq and nationwide anti-government protests in which hundreds of people have died, appeared to force the regime on to the defensive.

Iran’s military released a statement about the plane via the official IRNA news agency in the early hours of Saturday admitting the “unforgivable mistake” of shooting down Ukraine International Airlines flight 752 on Wednesday. The mea culpa came after three days of denials from officials in Tehran, who repeatedly dismissed western intelligence reports pointing to Iranian culpability as propaganda efforts in the midst of soaring tensions with the US.

In an unprecedented move, the supreme leader, Ayatollah Ali Khamenei, ordered an investigation into the hitherto untouchable Islamic Revolutionary Guard Corps, whose base outside Tehran launched the missile that downed flight 752.

A senior IRGC commander, Gen Amir Ali Hajizadeh, confessed publicly that he knew the plane had been shot down almost immediately after it happened, and asked for forgiveness. His statement was broadcast on YouTube. Hajizadeh, the head of the Revolutionary Guards’ aerospace division, apologised on television and said the group took full responsibility for the disaster, saying he wished he could die when he heard about the incident.

Facebook Twitter Pinterest Gen Amir Ali Hajizadeh, right, attends a mourning ceremony for Gen Qassem Suleimani the day after the plane crash. Photograph: AP

A missile operator acting alone because of a “communications breakdown” had mistaken the plane for a cruise missile heading towards a sensitive Revolutionary Guards site, and only had 10 seconds to decide whether to fire, he said. “He was obliged to make contact and get verification. But apparently, his communications system had some disruptions. Either the ‘jamming’ system was the cause or the network was busy,” said the general.

After repeating in interviews the official line that no missiles had been fired in the timeframe that could have caused the jet to crash, Iran’s ambassador to the UK, Hamid Baeidinejad, apologised on Saturday, expressing “regret for conveying such wrong findings”.

The regime’s apologies and promises to punish the culprits did little to staunch a flood of anger. Iranians used social media to vent their fury at being misled, while foreign governments accused Tehran of criminal irresponsibility.

Iranians asked on Twitter why the plane had been allowed to take off at a time of extreme tensions. Video taken outside Tehran University on Saturday showed students chanting “death to the dictator”, an apparent reference to Khamenei. There is mounting anger that the retaliatory strikes launched by Iran on US military bases in Iraq were finely calibrated to ensure no US casualties, but scores of Iranian and Iranian-Canadian passengers were killed by Iran’s own forces in the crash. Videos posted on social media showed hundreds of people gathering to protest at several Iranian universities, where students shouted “Khamenei is over”, and called his government “shameless”.

In a rare report on the civil unrest, the semi-official Fars news agency said demonstrators had ripped up pictures of the killed commander Suleimani.

Profile Who was Qassem Suleimani? Show Hide Qassem Suleimani, killed by a US drone strike in Baghdad, had become well known among Iranians and was sometimes discussed as a future president. Many considered Suleimani to have been the second most powerful person in Iran, behind supreme leader of Iran Ali Khamenei, but arguably ahead of President Hassan Rouhani. He was commander of the Quds Force, the elite, external wing of the Iran’s Islamic Revolutionary Guard Corps, which the Trump administration designated as a terror organisation in April last year. He was born in Rabor, a city in eastern Iran, and forced to travel to a neighbouring city at age 13 and work to pay his father’s debts to the government of the Shah. By the time the monarch fell in 1979, Suleimani was committed to the clerical rule of Ayatollah Ruhollah Khomeini, and joined the Revolutionary Guards, the paramilitary force established to prevent a coup against the newly declared Islamic Republic. Within two years, he was sent to the front to fight in the war against the invading Iraqi army. He quickly distinguished himself, especially for daring reconnaissance missions behind Iraqi lines, and the war also gave him his first contact with foreign militias of the kind he would wield to devastating effect in the decades to come. By the the time the Iraq government fell in 2003, Suleimani was the head of the Quds force and blamed for sponsoring the Shia militias who killed thousands of civilian Iraqis and coalition troops. As fighting raged on Iraq’s streets, Suleimani fought a shadow war with the US for leverage over the new Iraqi leadership. Once described by American commander David Petraeus as ‘a truly evil figure’, Suleimani was instrumental in crushing street protests in Iran in 2009. In recent months outbreaks of popular dissent in Lebanon, Iraq and Iran were again putting pressure on the crescent of influence he had spent the past two decades building. Violent crackdowns on the protests in Baghdad were blamed on militias under his influence.

Eighteen months before his death, Suleimani had issued Donald Trump a public warning, wagging his finger and dressed in olive fatigues. “You will start the war but we will end it.” Michael Safi Photograph: Mehdi Ghasemi/AFP

Meanwhile, Ukraine’s government demanded justice for the victims, including compensation. The US described the Iranian regime as “reckless” and called for more investigations. The secretary of state, Mike Pompeo, tweeted his support for the Iranian people, who he said were “fed up with the regime’s lies, corruption, ineptitude, and brutality”.

Trump tweeted his support for the Iranian people in English and Farsi. “To the brave, long-suffering people of Iran: I’ve stood with you since the beginning of my presidency, and my administration will continue to stand with you. We are following your protests closely, and are inspired by your courage.”

He added: “The government of Iran must allow human rights groups to monitor and report facts from the ground on the ongoing protests by the Iranian people. There can not be another massacre of peaceful protesters, nor an internet shutdown. The world is watching.”

Canada’s prime minister, Justin Trudeau, said he was “outraged and furious” and that Iran “must take full responsibility” for the “horrific” incident. Trudeau said the Iranian president, Rouhani, had told him in a phone call that Iran was committed to collaborating with Canadian investigators and would work to de-escalate tensions in the region.

Facebook Twitter Pinterest People in Vancouver, Canada, mourn for victims of the Iran plane crash. Photograph: Anadolu Agency via Getty Images

Apparently alarmed at the scale of the backlash, Iranian state television suggested the tragedy was being used by Iran’s enemies to undermine it. But Britain was among several countries suggesting that the admission could pave the way for renewed dialogue.

Boris Johnson said it was an “important first step” that “reinforces the importance of de-escalating tensions in the region”. The prime minister also echoed the calls of his Ukrainian and Canadian counterparts, whose nationals made up the majority of the non-Iranian victims in the crash, in calling for a “comprehensive, transparent and independent international investigation” into the tragedy.

Richard Ratcliffe: ‘My daughter’s home, now PM must get Nazanin back’ Read more

The jetliner, a Boeing 737-800, was targeted by two surface-to-air missiles three minutes after taking off from an airport on the outskirts of Tehran. It took to the air a few hours after Iran launched a barrage of ballistic missiles at US targets in Iraq and the military was braced for possible reprisals.

The plane, on its way to the Ukrainian capital, Kyiv, was carrying 167 passengers and nine crew members from several countries, including 82 Iranians, at least 57 Canadians, 11 Ukrainians and three Britons.

• This article was amended on 13 January 2020. An earlier version mistakenly said that Canadians and Ukrainians made up “the majority of the victims of the crash”. This has been corrected.