Four soldiers were killed near Baquba, northeast of Baghdad, when Shiite militiamen allied to the government sprayed gunfire on their ambulance, police said.
"The four soldiers were riding in an army ambulance when members of the popular brigades shot their vehicle on the main road near Mansuriyah, killing all of them," a police colonel said.
"They opened fire because they thought (the soldiers) were Islamic State fighters using the ambulance as a trick to attack their position," the officer said.
The jihadist group holds huge quantities of vehicles, weapons and uniforms looted from the army, making it difficult for pro-government forces to tell them apart from their own camp.
More From This Section
In Meshahda, just over 30 kilometres north of the capital, a bomber set off his suicide vest in the middle of a market, killing at least seven people and wounding 25.
"There were at least two women among the dead, and several women and children among the wounded," a police colonel from neighbouring Tarmiyah told AFP.
A doctor at Tarmiyah hospital confirmed the casualty figures.
According to an army captain and a doctor at Samarra hospital, the blast in Zalayah village also wounded nine people.
IS fighters rig roads and homes before withdrawing from areas they control, making it difficult for the army and allied groups to gain ground even after a military victory.