Its elite paramilitary unit, the Revolutionary Guard, compared the Sunni-ruled country to terror group ISIS and warned the ‘medieval act of savagery’ would lead to the monarchy’s downfall.

A controversial meme posted on an Iranian website, thought to belong to Supreme Leader Ayatollah Ali Khameni, suggested the only difference between Saudi rulers and ISIS executioners was the clothes they wore.

Saudi Arabia claimed Shiite cleric Sheikh Nimr al-Nimr and the other executed prisoners, which include three other Shiite dissidents and a number of al-Qaeda supporters, were all convicted ‘terrorists’. It said Iran had ‘revealed its true face as a supporter of terrorists’ by condemning al-Nimr’s death.

The escalating war of words came after a night of violence in the Iranian capital of Tehran, where a furious mob petrol bombed the Saudi embassy to protest al-Nimr’s killing. At least 40 were arrested on suspicion of attacking and setting fire to the embassy.

Iraq’s former Prime Minister Nouri Al-Maliki warned the executions would ‘topple the Saudi regime’, US and European said they risked ‘exacerbating sectarian tensions’, and UN Secretary-General Ban Ki-moon said he was ‘deeply dismayed’.

Al-Nimr, the most vocal critic of the Saudi dynasty, was the driving force behind the protests which broke out in the east of the country in 2011, where the Shiite minority claims they are fiercely persecuted.

Khamenei condemned Saudi Arabia for the second straight day over his execution, saying: ‘The unjustly spilled blood of this oppressed martyr [al-Nimr] will no doubt soon show its effect and divine vengeance will befall Saudi politicians.’

The Revolutionary Guard yesterday promised ‘harsh revenge’ against Saudi Arabia’s royal dynasty, but its foreign ministry called for calm after protesters tried to burn down its embassy in Tehran.

None of the Saudi embassy staff were inside the building when demonstrators broke in and trashed the offices. They forced their way inside where they ransacked rooms, destroyed furniture and started fires before they were ejected by police.

Tehran’s police chief said an unspecified number of ‘unruly elements’ were arrested for attacking the embassy with petrol bombs and rocks overnight.

Iranian President Hassan Rouhani, who condemned al-Nimr’s execution, said the attacks on the embassy were ‘unjustifiable’.

He ordered his Interior Ministry to arrest the attackers, who he described as ‘extremists’, and punish them for ‘such ugly acts’.

There have been reports of other revenge attacks against Saudi Arabia across the Middle East.

Footage from Iraq claimed to show Saudi Arabia’s newly reopened embassy in Baghdad engulfed in smoke after a rocket was reported to have been fired at it.

Helicopters circled high above the embassy in central Baghdad, which was targeted after the news of al-Nimr’s execution spread to Iraq, Russia Today reported.

Unconfirmed reports have claimed the rocket, which struck just metres away from the embassy, was fired by Iraqi Shiite militia group Harakat al-Nujaba.

The Saudi embassy reopened its doors on Friday after being closed for 25 – following the Iraqi invasion of Kuwait – to help strengthen an alliance against ISIS.

Violent demonstrations have also erupted across the Middle Eastern and Gulf countries, including Lebanon, Pakistan and Bahrain, while Muslims in the West have held peaceful marches.

Shiite protesters clashed with Indian police in the disputed Kashmir region today. They threw rocks at policemen, who retaliated with tear gas and rubber bullets.

Demonstrators in Bahrain were also met with tear gas as they fought with security forces, while hundreds also protested in Iraq’s Shiite holy city of Karbala.

Violent demonstrations have since erupted across the Middle Eastern and Gulf countries, including Lebanon, Pakistan and Bahrain, while Muslims in the West have held peaceful marches.

Thousands have also gathered in Lebanon’s capital, Beirut, ahead of a speech by the leader of the Lebanese Shiite militia group Hezbollah.

It issued a statement condemning al-Nimr’s execution, with Deputy Secretary General Sheikh Naim Qassem calling it ‘a sign of shame and weakness’ for Saudi Arabia

Meanwhile, hundreds of Shiite Muslims marched through the Qatif district of Saudi Arabia’s Eastern Province, closely watched by security services.

The US State Department said Saudi Arabia risked ‘exacerbating sectarian tensions’ and Ban Ki-moon said he was ‘deeply dismayed’ by the execution of al-Nimr.

‘Sheik al-Nimr and a number of the other prisoners executed had been convicted following trials that raised serious concerns over the nature of the charges and the fairness of the process,’ Ban’s spokesman said.

‘The Secretary-General also calls for calm and restraint in reaction to the execution of Sheikh Nimr and urges all regional leaders to work to avoid the exacerbation of sectarian tensions.’

Amnesty International spokesman Shane Enright said the death penalty was ‘unacceptable in all circumstances’ and it was particularly concerning that a number of ‘peaceful dissidents’ including al-Nimr had been killed.