A series of bombings in Baghdad and shelling in another Iraqi city killed 21 people on Tuesday, while police found the bodies of 18 security personnel north of the capital.
The violence came during a major offensive, spearheaded by the jihadist Islamic State of Iraq and the Levant but involving other groups, which overran all of one province and chunks of three more in a matter of days.
In the deadliest single attack, a car bomb exploded in a market in the predominantly-Shiite Muslim area of north Baghdad, killing at least 11 people and wounding more than 20, security and medical officials said.
Five more bombings in the capital killed a further six people and wounded 14, officials said.
In Fallujah, a city west of Baghdad that has been held by anti-government fighters for more than five months, shelling killed four people and wounded three, Dr Ahmed Shami said.
North of the capital, Iraqi police discovered the bodies of 18 security force members who had suffered gunshots to the head and chest.
The bodies were discovered 15 kilometres (9 miles) east of the city of Samarra. It was unclear if they had been executed or died in fighting.
Iraqi security forces performed poorly during the initial days of the militant assault, in some cases abandoning uniforms, vehicles and positions to flee.
They seem to have recovered somewhat from the shock of the onslaught, retaking certain areas, but the militants have continued to gain ground elsewhere.