Iraq asked the Swedish ambassador in Baghdad to leave the country following a Quran-desecrating incident in Stockholm on Thursday.
Baghdad has also recalled its charge d'affaires in Sweden, a government statement said.
The decision came after Iraq told Sweden it would sever diplomatic ties if a Quran is burned again, after hundreds of people stormed the Swedish embassy in Baghdad and set it alight in a protest.
Prime Minister Mohammed Shia al-Sudani had led an emergency meeting hours after the violent unrest which saw hundreds of protesters breach the Swedish compound, set fire to buildings and clash with riot police.
The Iraqi government strongly condemned the embassy attack but also issued a warning to Sweden if it allows the second Quran-burning protest within less than a month to go ahead as scheduled later in the day.
Baghdad had informed Stockholm "that any recurrence of the incident involving the burning of the Holy Quran on Swedish soil would necessitate severing diplomatic relations," said a statement from Sudani's office.
"Granting permission under the pretext of freedom of expression is viewed as provocative and contrary to international covenants and norms, which emphasize respect for religions and beliefs. Such actions are deemed a threat to peace and encourage a culture of violence and hatred."
On June 28, Sweden-based Iraqi refugee Salwan Momika had also burnt pages of the Quran, outside a Stockholm mosque, sparking a wave of indignation and anger across the Muslim world.
Momika on Facebook confirmed Swedish media reports that he was one of the organizers of the planned event, where they were also planning to burn the Iraqi flag.
News of those plans had set off the chaotic events before dawn in Baghdad, led by followers of powerful Shiite Muslim cleric and political leader Muqtada al-Sadr.
Hundreds massed at the embassy, weeks after a previous attack on the compound, scaled the walls and torched parts of it.
Rock-throwing protesters then clashed with Iraqi riot police who used electric batons and water cannon to disperse them.
One protester, Hassan Ahmed, told the AFP that "we mobilized today to denounce the burning of the Quran, which is all about love and faith."
"We demand that the Swedish government and the Iraqi government stop this type of action."
Some raised the Quran in the air, others held up portraits of al-Sadr and of his late father, Mohamed al-Sadr, a revered cleric in the majority Shiite country.
Calm has returned by morning when police blocked the road leading to the embassy, and the full extent of the fire damage was not yet clear.
Sweden's Foreign Ministry told AFP that all of its employees in Baghdad were "safe" during the unrest.
Swedish Foreign Minister Tobias Billstrom later said Iraq's charge d'affaires would be summoned.
"What has happened is completely unacceptable and the government condemns these attacks in the strongest terms," he said in a statement.
"Iraqi authorities have an unequivocal obligation to protect diplomatic missions and personnel under the Vienna Convention."
Sudani "strongly condemned burning the Swedish embassy in Baghdad, viewing it as a serious security breach requiring immediate action," the Iraqi government statement said.
"Those accountable for security must be held responsible," it added, as an Iraqi security source told AFP about 20 protesters had been taken into custody.
Iraq also said it "reaffirms its commitment to ensuring the security and protection of all diplomatic missions, vowing to confront any attacks targeted at them."
Sweden and other European countries have previously seen protests where far-right and other activists, citing free speech protections, damage or destroy religious symbols or books, commonly sparking protests and heightening diplomatic tensions.
Momika staged his previous Quran burning in front of Stockholm's largest mosque during Eid al-Adha, a holiday celebrated by Muslims around the world.
That incident prompted followers of al-Sadr to briefly storm the Swedish embassy in Baghdad the following day.
The powerful cleric has repeatedly mobilized thousands of demonstrators.
In the summer of 2022, during a dispute over the appointment of a new prime minister, Sadr supporters invaded Baghdad's parliament building and staged a sit-in that lasted several weeks.
Meanwhile, in a separate development, a Turkish court has issued an arrest warrant for far-right Danish politician Rasmus Paludan, who burned a copy of the Quran in front of the Turkish Embassy in Stockholm.
The incident, which took place on Jan. 21, sparked outrage and condemnation across the Islamic world.
The investigation launched by the Ankara Chief Public Prosecutor's Office against Paludan on the charge of "publicly insulting the religious values" is ongoing.
As part of the investigation, the Chief Public Prosecutor's Office requested Paludan's arrest to obtain a statement regarding the Quran-burning incident.
The Ankara 8th Criminal Court of Peace, upon evaluating the request, decided to issue an arrest warrant for the Danish politician.