A suicide bomber killed at least 27 Shi'ite militiamen outside the Iraqi town of Jurf al-Sakhar on Monday after security forces pushed Islamic State militants out of the area over the weekend, army and police sources said.
The attacker, driving a Humvee vehicle packed with explosives and likely stolen from defeated government troops, also wounded 60 Shi'ite Muslim militiamen, who had helped government forces retake the town just south of the capital.
Iraqis are bracing for more sectarian attacks on Shi'ites, who are preparing for the religious festival of Ashura, an event that defines Shi'ism and its rift with Sunni Islam.
At mosques and shrines across Iraq, millions of Shi'ites are expected to commemorate the slaying of Prophet Mohammad's grandson Hussein at the battle of Kerbala in AD 680.
Violence has in the past marred the run up to the event, which will take place next week, and the festival itself.
On Monday night, a car bomb killed at least 15 people in central Baghdad, police and medical sources said. The attack took place on a street with shops and restaurants in Karrada district, home to both Sunni and Shi'ite Muslims as well as other sects and ethnic groups.
Islamic State sees Shi'ites as infidels who deserve to die and their attacks on them have brought violence back to levels seen in 2006 and 2007 at the height of a civil war.
Holding Jurf al-Sakhar is critical for Iraqi security forces, who finally managed to drive out the Sunni insurgents after months of fighting and need to capitalise on their victory to keep the militants away from Baghdad.
It could also allow Iraqi forces to sever Islamic State connections to their strongholds in western Anbar province and stop them infiltrating the mainly Shi'ite Muslim south.
Pressure on Baghdad
The group has threatened to march on Baghdad, home to special forces and thousands of Shi'ite militias expected to put up fierce resistance if the capital comes under threat.
Gains against Islamic State, an al Qaeda offshoot made up of Arab and foreign fighters, are often fragile even with the support of U.S. air strikes on militant targets in Iraq and neighbouring Syria.
The United States led nearly a dozen air strikes against Islamic State militants in Syria and Iraq on Sunday and Monday, including the besieged Syrian Kurdish border town of Kobani, according to the U.S. military.
As Iraqi government soldiers and militias savoured their victory and were taking photographs of Islamic State corpses on Sunday, mortar rounds fired by Islamic State fighters who had fled to orchards to the west rained down on Jurf al-Sakhar.
The rounds hit the militiamen, killing dozens, according to a Reuters witness.
The next significant fighting near Baghdad is expected to take place in the Sunni heartland Anbar province.
The town of Amriyat al-Falluja has been surrounded by Islamic State militants on three sides for weeks. Security officials say government forces are gearing up for an operation designed to break the siege.
Gains in the Islamic State stronghold of Anbar could raise the morale of Iraqi troops after they collapsed in the face of a lighting advance by the insurgents in the north in June.
In a meeting with Sunni tribal leaders from Anbar broadcast on state television, Prime Minister Haider al-Abadi said:
"We need soldiers to sign up for the army to stay and defend the country, not to come to the army for livelihoods.
"We should focus on one front when we attack instead of fighting on more than one front because terrorists can switch the battle to another area. We should defeat them in one place and then move to the other front."
In order to stabilise Iraq, Abadi, a Shi'ite, must win over Sunnis, especially from Anbar, who have long believed Shi'ite leaders have a sectarian agenda. Some support Islamic State.
No letup to the violence
Islamic State kept up the pressure on security forces, attacking soldiers, policemen and Shi'ite militiamen in the town of al-Mansuriyah, northeast of Baghdad. Six members of the Iraqi security forces were killed, police said.
Kurdish peshmerga fighters also made advances over the weekend against Islamic State, which has declared a caliphate in the heart of the Middle East and is determined to redraw the map of the oil-producing region.
Much attention is focused on the planned deployment of peshmerga to Kobani, where fellow Kurds have been fending off an attack by Islamic State for 40 days.
Iraqi Kurdish officials and a member of the Kurdish administration in Syria said the peshmerga had been due to head to Kobani via Turkey on Sunday but their departure had been postponed.
Iraqi Kurdish forces will not engage in ground fighting in the Syrian town of Kobani but provide artillery support for fellow Kurds there, a Kurdish spokesman has said.
Islamic State fighters have been trying to capture Kobani for over a month, pressing on despite U.S.-led air strikes on their positions and the deaths of hundreds of their fighters.