(CNN) First, one man's execution spurred sectarian protests and violence in the Middle East. Now, it appears to have sparked a serious diplomatic rift.

Saudi Arabia's foreign minister said Sunday that his country is severing ties with Iran. Iranian diplomats in Saudi Arabia have 48 hours to leave the country, Saudi Foreign Minister Adel al-Jubeir told reporters.

The two countries have long been at odds, but Saudi Arabia's execution of Shiite cleric Nimr al-Nimr Saturday kicked off a new round of sparring between them that analysts say could mark a dangerous shift in an already volatile region.

"I think you're going to see a period of very harsh rhetoric, and the cutting of diplomatic ties comes at a very bad time. ... This is Saudi Arabia saying, 'The gloves are off,' " said Bobby Ghosh, a CNN global affairs analyst and managing editor of Quartz.

There was some damage near the back of the embassy building, witnesses and a police officer said. None of the Saudi diplomatic staff was in the embassy at the time.

There was some damage near the back of the embassy building, witnesses and a police officer said. None of the Saudi diplomatic staff was in the embassy at the time.

Several protesters were arrested, police officers at the embassy told CNN.

Several protesters were arrested, police officers at the embassy told CNN.

Iranian protesters gather outside the Saudi Embassy in Tehranon January 2. Saudi Arabia said it executed "terrorists" and told Iran to stay out of its internal affairs.

Iranian protesters gather outside the Saudi Embassy in Tehranon January 2. Saudi Arabia said it executed "terrorists" and told Iran to stay out of its internal affairs.

A firefighter sprays water on the flames on January 2 in Tehran, Iran, a Shiite-majority nation, issued a statement deploring the execution and warning that Saudi Arabia would pay a heavy price for its policies.

A firefighter sprays water on the flames on January 2 in Tehran, Iran, a Shiite-majority nation, issued a statement deploring the execution and warning that Saudi Arabia would pay a heavy price for its policies.

Smoke billows from the windows of the burning Saudi Embassy on January 2. A CNN producer in Tehran said some protesters made it inside the building, setting fire and ransacking some records.

Smoke billows from the windows of the burning Saudi Embassy on January 2. A CNN producer in Tehran said some protesters made it inside the building, setting fire and ransacking some records.

Protesters set fire to the Saudi Embassy in Tehran, Iran, on Saturday, January 2, during a demonstration against the execution of prominent Shiite Muslim cleric Nimr al-Nimr by Saudi authorities. Nimr was a driving force of the protests that broke out in 2011 in Saudi Arabia's east, an oil-rich region where the Shiite minority of an estimated 2 million people complains of marginalization.

Protesters set fire to the Saudi Embassy in Tehran, Iran, on Saturday, January 2, during a demonstration against the execution of prominent Shiite Muslim cleric Nimr al-Nimr by Saudi authorities. Nimr was a driving force of the protests that broke out in 2011 in Saudi Arabia's east, an oil-rich region where the Shiite minority of an estimated 2 million people complains of marginalization.

Iranian security guards Saudi Arabia's embassy in Tehran while a group of demonstrators gathered to protest on January 3.

Iranian security guards Saudi Arabia's embassy in Tehran while a group of demonstrators gathered to protest on January 3.

Iranian demonstrators burn representations of the U.S. and Israeli flags during a demonstration in front of the Saudi Arabian Embassy in Tehran on January 3.

Iranian demonstrators burn representations of the U.S. and Israeli flags during a demonstration in front of the Saudi Arabian Embassy in Tehran on January 3.

Tehran's police chief Gen. Hossein Sajedinia, center right, tries to disperse protesters in front of Saudi Arabia's Embassy in Tehran on January 3.

Tehran's police chief Gen. Hossein Sajedinia, center right, tries to disperse protesters in front of Saudi Arabia's Embassy in Tehran on January 3.

Iranian protesters hold portraits of prominent Shiite Muslim cleric Nimr al-Nimr as they confront riot police during a demonstration against his execution by Saudi authorities on Sunday, January 3, outside the Saudi embassy in Tehran, Iran. Saudi Foreign Minister Adel al-Jubeir told reporters that Saudi Arabia is severing ties with Iran after an attack on the embassy.

Al-Jubeir said his country was severing ties with Iran after an attack this weekend on the Saudi embassy in Tehran.

That attack came after Saturday's execution of al-Nimr, a fervent dissident against the Sunni Muslim Saudi royal family who called for their deposal during the Arab spring uprisings in 2011.

Later that night, in predominantly Shia Iran, Molotov cocktails smashed into the Saudi embassy in Tehran. Protesters shouted as it caught fire. Some went inside and ransacked offices.

Severing ties was a last resort, a source familiar with Saudi Arabia's decision said, because Saudi Arabia views Iran's behavior as unacceptable and feels no country is doing anything to counter it.

"This was the Saudis saying, 'Enough. We've had it,' " the source said.

Iran: 'Divine revenge'

Earlier, the Iranian government had summoned the Saudi ambassador to condemn al-Nimr's execution. Saudi Arabia returned the slap, summoning the Iranian ambassador in Riyadh to vehemently object to Iran's condemnation.

In Iran, the last word belongs to Supreme Leader Ayatollah Ali Khamenei. And on Sunday, he tweeted, "Doubtlessly, unfairly-spilled blood of oppressed martyr #SheikhNimr will affect rapidly & Divine revenge will seize Saudi politicians."

Doubtlessly, unfairly-spilled blood of oppressed martyr #SheikhNimr will affect rapidly & Divine revenge will seize Saudi politicians. — Khamenei.ir (@khamenei_ir) January 3, 2016

Al-Nimr was an outspoken critic but nonviolent, Khamenei said.

The supreme leader also posted to his website a critical illustration that compared a Saudi Arabian executioner to an ISIS Jihadi preparing to behead a victim. The illustration calls them "white ISIS" and "black ISIS" and asks, "Any differences?"

Iran's supreme leader compares Saudi Arabia to ISIS over the execution of a Shiite cleric activist

After the embassy attack, police donned riot gear and arrested 40 people.

Iranian President Hassan Rouhani condemned al-Nimr's execution in Saudi Arabia but also blasted the attack on the Saudi embassy in Tehran and on a Saudi consulate in another Iranian city.

"In no way is this justifiable & foremost disrespects #Iran. All Iranian officials are fully committed to confront these illegal acts," he said in a tweet.

In no way is this justifiable & foremost disrespects #Iran. All Iranian officials are fully committed to confront these illegal acts 2/4 — Hassan Rouhani (@HassanRouhani) January 3, 2016

Saudi Arabia and Iran are already bitter rivals. And current regional conflicts have stoked animosity between them.

In Yemen, Saudi Arabia is fighting against Houthi rebels, who are allied with Iran. And in Syria, Saudi Arabia advocates the overthrow of President Bashar al-Assad, who is an ally of Tehran.

On Sunday, protesters took to the streets again in Iran, as well as in Iraq, to condemn al-Nimr's execution.

Iraq: 'Topple the Saudi regime'

In Iraq, a Shia icon directed followers to protest in front of the Saudi Arabian embassy in Baghdad. Cleric and politician Muqtada al-Sadr also called on Shia-dominated government to shut the embassy down.

The 47 condemned were either shot by firing squad or beheaded. Though the Saudi government did not say how al-Nimr died, beheading has a special meaning to Shiites, as it was the fate of a historic cleric, Imam Husayn.

JUST WATCHED Saudi Arabia executes 47 people Replay More Videos ... MUST WATCH Saudi Arabia executes 47 people 00:45

Al-Sadr made the assumption that al-Nimr had suffered the same fate. "He was executed with a sword, the same way ISIS scoundrels (do it)," he said.

Al-Sadr's word carries weight with Shiites beyond Iraq's border, and the spiritual leader called for them to protest, too -- including in Saudi Arabia.

Iraqi Vice President Nuri al-Maliki castigated the Saudi royal family with the dead dissident's own wishes. "The crime of executing Sheikh Nimr al-Nimr will topple the Saudi regime," he said.

In Lebanon, which also suffers from the Shia-Sunni divide, the Shiite militia Hezbollah called al-Nimr's death sentence corrupt and said his execution amounted to assassination.

Hassan Nasrallah, Hezbollah's secretary-general, said in televised remarks that the execution was shocking, Iranian state media reported.

"Any hope for Saudi rational behavior has ended," Nasrallah said, according to sate-run Press TV. "When a regime loses its mind, that means it has reached the abyss."

Who was Sheikh Nimr al-Nimr?

Al-Nimr died on Saturday alongside 46 terrorism convicts. He was the imam of a mosque in a majority Shiite area of eastern Saudi Arabia, where people have long complained of discrimination at the hands of the Sunni majority.

Iran's rise as a regional power in the Middle East has exacerbated those tensions, resulting in what human rights advocates call a systematic crackdown on minority Shiites in the kingdom.

When the Arab Spring uprisings rolled around in 2011, al-Nimr ardently supported anti-government protests in Saudi Arabia. He wanted the Saudi royal family deposed but publicly advocated peaceful protests over violence.

"The weapon of the word is stronger than bullets, because authorities will profit from a battle of weapons," he told the BBC

On Sunday, Al-Nimr's brother, Mohammed al-Nimr, called for the cleric's supporters to protest against his execution and to do so peacefully.

"I am calling on people not to get dragged into violence and to practice restraint and avoid bloodshed," he told CNN.

What was he convicted of?

In 2012, Saudi Arabia accused al-Nimr of fleeing authorities, ramming a security forces vehicle and resisting arrest. His family and critics have disputed the government's account.

Authorities shot al-Nimr in the leg during the arrest, and his family said that he had been denied proper treatment for his wounds during his imprisonment -- much of which Amnesty said was spent in solitary confinement.

A Saudi court convicted al-Nimr in 2014 after what Amnesty International described as a "deeply flawed" trial marked by numerous irregularities. The sheikh was not allowed to prepare a proper defense, Amnesty said.

"Eyewitnesses, whose testimonies were the only evidence used against him, were not brought to court to testify. This violates the country's own laws," Said Boumedouha of Amnesty International said.

Al-Nimr was convicted of inciting sectarian strife, sedition and breaking allegiance with the Saudi ruler. He was sentenced to death.

U.S. criticizes Saudi Arabia

Human rights activists saw al-Nimr not as an insurgent but as a dissenter and were appalled at the sentence.

Amnesty International said the case against him was part of a systematic effort by the majority Sunni government to crush Shia voices.

His execution prompted the U.S. State Department to call on Saudi Arabia to respect human rights and permit peaceful dissent.

"We are particularly concerned that the execution of (al-Nimr) risks exacerbating sectarian tensions at a time when they urgently need to be reduced," spokesman John Kirby said.

In response to the Saudi foreign minister's announcement severing ties with Iran on Sunday, Kirby said the United States believes diplomatic engagement is essential and "will continue to urge leaders across the region to take affirmative steps to calm tensions."

European Union High Representative for Foreign Affairs Federica Mogherini said al-Nimr's case raised "serious concerns regarding freedom of expression and the respect of basic civil and political rights."

U.N. Secretary-General Ban Ki-moon was "deeply dismayed" by the executions and called again for an end to the death penalty. He called on leaders in the region to prevent an escalation of sectarian tensions.