Iraq expelled the Swedish ambassador on Thursday in protest at a planned burning of the Quran in Stockholm that had prompted hundreds of protesters to storm and set alight the Swedish embassy in Baghdad.
An Iraqi government statement said Baghdad had also recalled its charge d'affaires in Sweden, and Iraq's state news agency reported that Iraq had suspended the working permit of Sweden's Ericsson on Iraqi soil.
Anti-Islam protesters, one of whom is an Iraqi immigrant to Sweden that burned the Quran outside a Stockholm mosque in June, had applied for and received permission from Swedish police to burn the Quran outside the Iraqi embassy on Thursday.
In the event, the protesters kicked and partially destroyed a book they said was the Quran but left the area after one hour without setting it alight. The Quran, the central religious text of Islam, is believed by Muslims to be a revelation from God.
Swedish Foreign Minister Tobias Billstrom said embassy staff were safe but Iraqi authorities had failed in their responsibility to protect the embassy.
The Iraqi government strongly condemned the burning of the Swedish embassy, according to a statement from the office of Iraqi Prime Minister Mohammed Shia Al-Sudani which declared it a security breach and vowed to protect diplomatic missions.
But Baghdad had also "informed the Swedish government... that any recurrence of the incident involving the burning of the Holy Quran on Swedish soil would necessitate severing diplomatic relations", the statement said.
The decision to recall the charge d'affaires to Sweden came while the protest in Stockholm had started but before the protesters had left without burning the Koran.
Billstrom said the storming of the embassy was "completely unacceptable and the government strongly condemns these attacks". He added: "The government is in contact with high-level Iraqi representatives to express our dismay."
In Washington, the State Department strongly condemned the attack on the embassy and criticised Iraq's security forces for not preventing protesters from breaching the diplomatic post.
The European Union also strongly condemned the attack and said it looked forward to "swift adoption of the necessary security measures" by Iraq to prevent further incidents.
Thursday's demonstration was called by supporters of Shiite cleric Muqtada al-Sadr to protest at the second planned Koran burning in Sweden in weeks, according to posts in a Telegram group linked to the influential cleric and other pro-Sadr media.
Sadr, one of Iraq's most powerful figures, commands hundreds of thousands of followers, whom he has at times called to the streets, including last summer when they occupied Baghdad's heavily fortified Green Zone and engaged in deadly clashes.
He stood by the embassy storming on Thursday, telling a press conference the US "has no right to condemn the burning of the Swedish embassy but should have condemned the burning of the Quran."
Headache for Swedish government
Several videos posted to the Telegram group, One Baghdad, showed people gathering around the Swedish embassy around 1am on Thursday (2200 GMT on Wednesday) chanting pro-Sadr slogans and storming the embassy complex about an hour later.
"Yes, yes to the Quran," protesters chanted.
Videos later showed smoke rising from a building in the embassy complex and protesters standing on its roof.
By dawn on Thursday, security forces had deployed inside the embassy and smoke rose from the building as firefighters extinguished stubborn embers, according to Reuters witnesses.
Sweden has seen several Quran burnings in recent years, mostly by far-right and anti-Muslim activists. Some burnings sparked clashes between police and Muslim protesters in Sweden.
The burnings caused outrage in the Muslim world. Swedish security services said such acts left the country less safe.
The police rejected some applications earlier this year for protests set to include Quran burning, citing security concerns, but courts have overturned those decisions, saying such acts are protected by Sweden's far-reaching freedom of speech laws.
The freedom of speech laws are protected by the constitution and cannot be easily changed, but the government has said it is considering legal changes that would allow police to stop public burnings if they endanger Sweden's security.
The burnings also complicated Sweden's bid to join Nato. While Turkey said this month it will ratify Sweden's application, previous burnings have angered Turkish President Tayyip Erdogan.
Sweden's Prime Minister Ulf Kristersson has criticised the burnings and said that while they are legal, they are inappropriate.