TEHRAN, Iran -- Protesters in Iran, angered by the execution by Saudi Arabia of a prominent Shiite cleric, broke into the Saudi embassy in Tehran early Sunday, setting fires and throwing papers from the roof, Iranian media reported.

The semiofficial ISNA news agency said the country's top police official, Gen. Hossein Sajedinia, rushed to the scene and police worked to disperse the crowd outraged by the execution of Sheikh Nimr al-Nimr. Shiite leaders in Iran and other countries across the Middle East swiftly condemned Riyadh and warned of sectarian backlash.

Saudi Arabia's execution Saturday of 47 prisoners, which also included al Qaeda detainees, threatened to further enflame Sunni-Shiite tensions in a regional struggle playing out between the Sunni kingdom and its foe Iran, a predominantly Shiite nation.

While Saudi Arabia insisted the executions were part of a justified war on terrorism, Iranian politicians warned that the Saudi monarchy would pay a heavy price for the death of al-Nimr.

The Iranian Foreign Ministry summoned the Saudi envoy in Tehran to protest, while the Saudi Foreign Ministry later said it had summoned Iran's envoy to the kingdom to protest the critical Iranian reaction to the sheikh's execution, saying it represented "blatant interference" in its internal affairs.

In Tehran, the crowd 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, Sajedinia told the semi-official Tasnim news agency.

"Some of them entered the embassy. Currently, individuals who entered the embassy have been transferred out (of the building). However, a large crowd is still there in front of the embassy," Sajedinia told ISNA early Sunday.

Some of the protesters broke into the embassy and threw papers off the roof, and police worked to disperse the crowd, Sajedinia told ISNA. He later told Tasnim that police had removed the protesters from the building and arrested some of them. He said the situation outside the embassy "had been defused."

Al-Nimr's execution promises to open a rancorous new chapter in the ongoing Sunni-Shiite power struggle playing out across the Middle East, with Saudi Arabia and Iran as the primary antagonists. The two regional powers already back opposing sides in civil wars in Yemen and in Syria. Saudi Arabia was also a vocal critic of the recent Iranian agreement with world powers that ends international economic sanctions in exchange for limits on the Iranian nuclear program.

The cleric's execution could also complicate Saudi Arabia's relationship with the Shiite-led government in Iraq. The Saudi embassy in Baghdad reopened for the first time in nearly 25 years on Friday. Already on Saturday there were public calls for Prime Minister Haidar al-Abadi to shut the embassy down again.

Al-Abadi tweeted Saturday night that he was "shocked and saddened" by al-Nimr's execution, adding that, "peaceful opposition is a fundamental right. Repression does not last."

Hundreds of al-Nimr's supporters also protested in his hometown of al-Qatif in eastern Saudi Arabia, in neighbouring Bahrain where police fired tear gas and bird shot, and as far away as northern India.

The sheikh's brother, Mohammed al-Nimr, said in a telephone interview that Saudi authorities told the family they had already buried the body, but didn't tell them at which cemetery. The family had hoped to bury his body in his hometown. His funeral would likely have attracted thousands of supporters, including large numbers of protesters. Instead the family planned to hold prayers and accept condolences at the mosque in a village near al-Qatif, where the sheikh used to pray.

A spokesman said in a statement that United Nations Secretary-General Ban Ki-moon was "deeply dismayed" over the Saudi Arabia executions, including that of Al-Nimr.

Germany's Foreign Ministry said the cleric's execution "strengthens our existing concerns about the growing tensions and the deepening rifts in the region."

State Department spokesman John Kirby said in a statement that the U.S. is "particularly concerned" that al-Nimr's execution risked "exacerbating sectarian tensions at a time when they urgently need to be reduced." He said the U.S. is calling on Saudi Arabia to ensure fair judicial proceedings and permit peaceful expression of dissent while working with all community leaders to defuse tensions after the executions.

Al-Nimr's death comes 11 months after Saudi Arabia issued a sweeping counterterrorism law after Arab Spring protests shook the region in 2011 and toppled several longtime autocrats. The law codified that the kingdom could prosecute as a terrorist anyone who demands reform, exposes corruption or otherwise engages in dissent or violence against the government.

The convictions of those executed Saturday were issued by Saudi Arabia's Specialized Criminal Court, established in 2008 to try terrorism cases.

The executed al Qaeda detainees were convicted of launching a spate of attacks against foreigners and security forces a decade ago.

To counter Arab Spring rumblings that threatened to spill into eastern Saudi Arabia, the kingdom sent troops in 2011 to crush Shiite protests demanding more political powers from the Sunni-led, fraternal monarchy of Bahrain. More security forces were also deployed that year to contain protests in Saudi Arabia's oil-rich east, where al-Nimr rallied youth who felt disenfranchised and persecuted.

A Saudi lawyer in the eastern region told The Associated Press that three other Shiite political detainees were also executed from among the 47. The lawyer spoke on condition of anonymity for fear of reprisal.

Saudi Arabia says all those executed were convicted of acts of terrorism. Al-Nimr and the three others mentioned had been charged in connection with violence that led to the deaths of several protesters and police officers.

Saudi Arabia's top cleric Grand Mufti Sheikh Abdulaziz Al Sheikh defended the executions as in line with Islamic Shariah law. He described the executions as a "mercy to the prisoners" because it would save them from committing more evil acts and prevent chaos.

Islamic scholars around the world hold vastly different views on the application of the death penalty in Shariah law. Saudi Arabia's judiciary adheres to one of the strictest interpretations, a Sunni Muslim ideology referred to as Wahhabism.

Saudi Arabia carries out most executions through beheading and sometimes in public and has drawn comparisons to extremist groups like al Qaeda and the Islamic State group -- which also carry out public beheadings and claim to be implementing Shariah. It strongly rejects the comparisons and points out that it has a judicial appeals process with executions ultimately aimed at combating crime.

The Lebanese Shiite militant group Hezbollah issued a statement calling al-Nimr's execution an "assassination" and a "ugly crime." The group added that those who carry the "moral and direct responsibility for this crime are the United States and its allies who give direct protection to the Saudi regime."

In a press conference Saturday, Saudi Interior Ministry spokesman Maj. Gen. Mansour al-Turki said the executions were carried out inside prisons and not in public, as is sometimes the case. The Interior Ministry, which announced the names of all 47 people executed in a statement, said a royal court order was issued to implement the sentences after all appeals had been exhausted.

Meanwhile, the execution of al Qaeda militants raised concerns over revenge attacks. The extremist group's branch in Yemen, known as al Qaeda in the Arabian Peninsula, had threatened violence against Saudi security forces last month if they carried out executions of its fighters.

One of the executed was Faris al-Shuwail, a leading ideologue in al Qaeda's Saudi branch who was arrested in August 2004 during a massive crackdown on the group following the series of deadly attacks.

The executions took place in the capital, Riyadh, and 12 other cities and towns. Of those executed, 45 were Saudi citizens, one was from Chad and another was from Egypt.

In announcing the verdicts, Saudi state television showed mugshots of those executed. Al-Nimr was No. 46, expressionless with a grey beard, his head covered with the red-and-white scarf traditionally worn by men in the Arab Gulf region.

Al-Nimr, who was in his 50s, never denied the political charges against him, but maintained he never carried weapons or called for violence.

At his trial, he was asked if he disapproved of the Al Saud ruling family because of speeches in which he spoke out forcefully against former Interior Minister and late Crown Prince Nayef bin Abdelaziz, who is King Salman's elder brother.

"If injustice stops against Shiites in the east, then (at that point) I can have a different opinion," the cleric responded, according to his brother, who attended court sessions and spoke to The Associated Press just days before the Oct. 2014 verdict.

U.S.-based Human Rights Watch's Middle East director Sarah Leah said "regardless of the crimes allegedly committed, executing prisoners in mass only further stains Saudi Arabia's troubling human rights record." She said al-Nimr was convicted in an "unfair" trial and that his execution "is only adding to the existing sectarian discord and unrest."

Al-Nimr's brother told the AP by telephone that the executions came as a "big shock" because "we thought the authorities could adopt a political approach to settle matters without bloodshed." He urged people to "adopt peaceful means when expressing their anger."

Saudi Arabia carried out at least 157 executions in 2015, with beheadings reaching their highest level in the kingdom in two decades, according to human rights groups.

Associated Press writers Aya Batrawy in Dubai, United Arab Emirates, Jon Gambrell in Dubai, Maamoun Youssef in Cairo, Reem Khalifa in Manama, Bahrain, Sinan Salaheddin in Baghdad and Bassem Mroue in Beirut contributed to this report.