Sunni Muslim Saudi Arabia on Saturday executed a prominent Shia cleric, prompting outrage in Shia-majority Iran, where angry crowds set fire to the kingdom's embassy and consulate.
Nimr al-Nimr, 56, who spent more than a decade studying theology in Iran, was a driving figure behind anti-government protests in Saudi Arabia in 2011.
He was put to death along with 46 other men, including Shia activists and Sunnis accused of involvement in Al-Qaeda killings, the Saudi interior ministry said.
The executions sparked protests in at least one city in Saudi Arabia's oil-rich Eastern Province, where Shias complain of marginalisation, as well as in Iran, Iraq and Bahrain.
The strongest condemnation came from Riyadh's longtime rival Tehran.
"The Saudi government supports terrorist movements and extremists, but confronts domestic critics with oppression and execution," Iranian foreign ministry spokesman Hossein Jaber Ansari said.
It will "pay a high price for following these policies," he warned.
Saudi foreign ministry spokesman Mansur al-Turki called Iran's reaction "irresponsible", and Riyadh summoned Tehran's envoy in protest.
Soon after, protesters hurled petrol bombs and stormed the Saudi embassy in Tehran before being cleared out by police, ISNA news agency reported, adding that flames could be seen rising form the building.
"The fire has destroyed the interior of the embassy," an eyewitness told AFP. "The police are everywhere and have dispersed the demonstrators, some of whom have been arrested."
Websites carried pictures of demonstrators apparently clutching the Saudi flag, which had been pulled down.
In Mashhad, Iran's second biggest city, demonstrators meanwhile set fire to the Saudi consulate, according to news sites, carrying pictures of the alleged assault.
The incidents came after the EU expressed concern about possible "dangerous consequences" in a region already fraught with sectarian tensions.
The United States echoed those fears, warning that Saudi Arabia risked "exacerbating sectarian tensions at a time when they urgently need to be reduced".
"In this context, we reiterate the need for leaders throughout the region to redouble efforts aimed at de-escalating regional tensions," said State Department spokesman John Kirby.
Tehran ally Hezbollah, Lebanon's Shia movement, said Saudi Arabia's rulers were "global criminals" and denounced Nimr's execution as a "heinous crime".
Saudi's interior ministry said the 47 executed men had been convicted of adopting the radical "takfiri" ideology, joining "terrorist organisations" and implementing various "criminal plots".
An official list published included Sunnis convicted of involvement in Al-Qaeda attacks that killed Saudis and foreigners in 2003 and 2004.
Some of them had been convicted of taking part in May 2003 attacks on expatriate compounds in Riyadh that killed 35 people, nine of them Americans, the ministry said.
Others were involved in 2004 attacks on a housing complex in the eastern city of Khobar, in which 22 people were killed, most of them foreigners, and other assaults.
Among them was Fares al-Shuwail, described by Saudi media as Al-Qaeda's top religious leader in the kingdom.
All those executed were Saudis, except for an Egyptian and a Chadian.
Some were beheaded, while others were shot by firing squad, said the ministry spokesman.
The Bahraini government and the United Arab Emirates voiced support for the conservative kingdom, saying the executions were necessary to confront extremism.
Nimr was arrested in 2012, three years after calling for Eastern Province's Shia-populated Qatif and Al-Ihsaa governorates to be separated from Saudi Arabia and united with Bahrain.
The interior ministry had described him at the time of his arrest as an "instigator of sedition".
A video on YouTube in 2012 showed Nimr making a speech celebrating the 2012 death of then-interior minister Prince Nayef bin Abdulaziz.
"Let the worms eat him," Nimr had said, while also criticising the rulers of Saudi Arabia and Bahrain, where the Shia community has also complained of marginalisation.