Sudan also said Monday it was severing its diplomatic relations with Iran, adding that the decision would take effect immediately. And the state-run news agency of the United Arab Emirates said the country is downgrading its diplomatic relations with Iran to only focus on business relationships. The UAE's Foreign Ministry also said it was recalling its ambassador from Tehran.

Saudi Arabia's U.N. Mission insisted the kingdom granted "fair and just trials" to 47 people who were executed last weekend, responding to concerns raised by the U.N. chief over the fairness of the judicial proceedings.

The Saudi mission, in a statement sent to The Associated Press, expressed "deep regret" at a statement from U.N. Secretary-General Ban Ki-moon's spokesman on Saturday saying al-Nimr and a number of other prisoners executed were convicted after trials "that raised serious concerns over the nature of the charges and the fairness of the process."

The Saudi statement assured the U.N. chief of "the independence and impartiality of the judiciary authority." It said state-appointed lawyers were provided to some of the defendants, and that appeals in some of the cases took up to 10 years.

The statement said the final rulings against the 47 people executed were reached "based on their own criminal and illegal actions" without consideration of their intellectual, racial or sectarian background.

Meanwhile, Saudi Arabia's civil aviation authority announced Monday on Twitter that all flights to and from Iran had been cancelled.

Adel al-Jubeir, the Saudi foreign minister, accused Iranian authorities of being complicit in the embassy attack, saying that documents and computers were taken during the raid.

He said the Saudi diplomatic representative had sought help from the Iranian foreign ministry when the building was stormed, but the requests were ignored three times.

The developments illustrate Saudi Arabia's new aggressiveness under King Salman. During his reign, the country has led a coalition fighting Shia rebels in Yemen and staunchly opposed regional Shia power Iran, even as Tehran struck a nuclear deal with world powers.

Speaking to Al Jazeera from Beirut, Lebanon, Joseph Kechichian, a Middle East analyst, said the Saudi decision to suspend diplomatic ties was “quite a surprise.”

“This is an escalation that will create havoc in the region,” he said, referring to the latest developments.

Ellie Geranmayeh, an Iran expert at the European Council on Foreign Relations, said the Saudi decision was likely to have repercussions for the region, particularly concerning the Syrian negotiations.

“Western powers must increase efforts to safeguard this process and encourage the Saudis and Iran to continue their participation [in the Syria peace talks],” she told Al Jazeera from London.

“These events further set back the urgently needed rapprochement between Tehran and Riyadh, and spell further trouble for an already fragile region.”

Friction between Saudi Arabia and Iran rose sharply on Saturday after Saudi Arabia announced the execution of al-Nimr along with 46 other prisoners, including three other Shia dissidents and dozens of Sunni Al-Qaeda fighters. It was the largest mass execution carried out by the kingdom in three and a half decades.

Al-Nimr was a central figure in protests by Saudi Arabia's Shia minority until his arrest in 2012, and his execution drew condemnation from Shias across the Middle East.

Prior to the Saudi announcement on cutting diplomatic ties, Iran's top leader had warned Saudi Arabia of “divine revenge” over the cleric's execution. Riyadh meanwhile accused Tehran of supporting “terrorism.”

The Iranian Foreign Ministry had summoned the Saudi envoy in Tehran to protest, while the Saudi Foreign Ministry summoned Iran's envoy to the kingdom to protest that country's criticism of the execution, saying it represented “blatant interference” in its internal affairs.

By early Sunday morning in Tehran, a crowd had gathered outside the Saudi Embassy and chanted anti-Saudi slogans. Some protesters threw stones and Molotov cocktails at the embassy, setting off a fire in part of the building, said the country's top police official, Gen. Hossein Sajedinia, according to the semi-official Tasnim news agency.

He later said police had removed the protesters from the building and arrested some of them, adding that the situation had been “defused.”

A Tehran prosecutor said 40 people were arrested on suspicion of taking part in the embassy attack and investigators were pursuing other suspects, according to the semi-official ISNA news agency.

Iranian President Hassan Rouhani, while condemning Saudi Arabia's execution of al-Nimr, also branded those who attacked the Saudi Embassy as “extremists.”

“It is unjustifiable,” he said in a statement.

Saudi Arabia's Foreign Ministry said that by condemning the execution, Iran had “revealed its true face represented in support for terrorism.”

The statement, carried by the official Saudi Press Agency, accused Tehran of “blind sectarianism” and said that “by its defense of terrorist acts“ Iran is a “partner in their crimes in the entire region.”

Al-Nimr was convicted of “terrorism” charges but denied ever advocating violence.

Sunni Saudi Arabia and Shia Iran are locked in a bitter rivalry, and support opposite sides in the wars in Syria and Yemen. Iran accuses Saudi Arabia of supporting “terrorism” in part because it backs Syrian rebel groups, while Riyadh points to Iran's support for the Lebanese Hezbollah and other Shia fighters in the region.

The cleric's execution could also complicate Saudi Arabia's relationship with the Shia-led government in Iraq. The Saudi Embassy in Baghdad is preparing to formally reopen for the first time in nearly 25 years. Already on Saturday there were public calls for Prime Minister Haider al-Abadi to shut the embassy down again.

Al-Nimr's supporters protested in his hometown of al-Qatif in eastern Saudi Arabia, in neighboring Bahrain where police fired tear gas and birdshot, in Lebanon and as far away as northern India.

The last time Saudi Arabia carried out a mass execution on this scale was in 1980, when the kingdom executed 63 people convicted over the 1979 seizure of the Grand Mosque in Mecca, Islam's holiest city. Extremists held the mosque, home to the cube-shaped Kaaba toward which Muslims around the world pray, for two weeks as they demanded the royal family abdicate the throne.

Al Jazeera and wire services