A suicide bomber blew himself up at a military recruiting centre in Baghdad, killing at least 21 people.
Volunteers were queueing up inside the building to register when the bomb went off. At least 35 people were wounded, police said.
The attack was believed to have been a warning to the government after it called for volunteers to help fight al-Qaida-linked militants in Anbar province.
Fighters with Islamic State of Iraq and Levant (ISIS) have invaded parts of Fallujah and Ramadi and seized control of police stations and military posts, freeing prisoners and setting up their own checkpoints.
Iraqi troops have been clashing with the fighters and carrying out airstrikes in an effort to regain control of the cities.
US vice-president Joe Biden has spoken to Iraqi prime minister Nouri al-Maliki twice recently in a show of support for his government's efforts to regain control of the cities. Biden urged Maliki to continue talks with local, tribal and national leaders.
Iran too has expressed its concern and offered to supply military equipment and advisers to help fight militants in Anbar.
International NGO Human Rights Watch said: "Iraqi government forces appear to have used indiscriminate mortar fire in civilian neighbourhoods in Anbar province.
"Unlawful methods of fighting by all sides have caused civilian casualties and severe property damage."
Some residential areas were targeted even though there was no signs of an al-Qaida presence in those specific areas.
The NGO has also warned that a government blockade of Ramadi and Fallujah was limiting civilian access to food, water and fuel. Some families have sought refuge in the neighbouring province of Karbala and the northern Kurdish region.
The Red Crescent has reported that it sent convoys with food aid to both cities but could not enter because of heavy fighting.
Sectarian tensions have been causing chaos for months in Sunni-dominated Anbar province as minority Sunnis rise up against alleged discrimination and arbitrary arrests by the Shiite-led government.