Saudi Arabia has announced it is severing diplomatic ties with Iran following Saturday's attack on its embassy in Tehran during protests against executions in the kingdom.

Adel al-Jubeir, the Saudi foreign minister, made the announcement on Sunday while the foreign ministry said it was asking Iranian diplomatic mission to leave the kingdom within 48 hours.

The Saudi foreign ministry also announced that the staff of its diplomatic mission had been evacuated and were on their way back to the kingdom.

Later reports said the flight carrying the Saudi embassy staff had landed in Dubai in the UAE.

Saudi Arabia's interior ministry announced on Saturday the execution of 47 people on terrorism charges, including a convicted al-Qaeda leader and a Shia religious leader.

Many of the men executed had been linked to attacks in Saudi Arabia between 2003 and 2006, blamed on al-Qaeda.

READ MORE: The oil price, Iran and Saudi's economy

Four of those executed were said to be Shia.

Nimr al-Nimr, the Shia leader, was accused of inciting violence and leading anti-government protests in the country's east in 2011. He was convicted of sedition, disobedience and bearing arms.

He did not deny the political charges against him, but said he never carried weapons or called for violence.

Nimr spent more than a decade studying theology in predominantly Shia Iran.

His execution prompted demonstrations in a number of countries, with protesters breaking into the Saudi embassy in Tehran late on Saturday night and starting fires.

At Sunday's press conference in Riyadh, Jubeir 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.

He accused the Iranian authorities of being complicit in the attack, saying that documents and computers were taken from the embassy building.

Calling the incident an act of "aggression", he said Iran had a history of "violating diplomatic missions", citing the attacks on the US embassy in Tehran in 1979 and the British embassy in 2011.

"These ongoing aggressions against diplomatic missions are a violation of all agreements and international conventions," he said, calling them part of an effort by Iran to "destabilise" the region.

Speaking to Al Jazeera from Beirut, Lebanon, Joseph Kechichian, a Middle East analyst, said the Saudi decision was "quite a surprise".

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

Iranian action

Earlier on Sunday, Iranian President Hassan Rouhani ordered the arrest and prosecution of individuals involved in the embassy attack, while also condemning the execution of Nimr.

Asked at the press conference what other steps the Saudis would take against Iran, Jubeir said "we will cross each bridge when we will get to it".

"We are determined not to allow Iran to undermine our security," he said.

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."