The sources said 46 others were wounded in the broad daylight attacks.
“There was first a car bomb explosion in the market which was followed by armed men shooting randomly on civilians and on shops in the market,” an Interior Ministry source said.
The sources said gunmen arrived in several cars and opened fire as they drove through the market street.
Doctors at Baghdad’s Yarmuk hospital said they had received some of the dead and wounded from the attack in Mahmudiyah, 30 kilometres from Baghdad.
An Iraqi army officer said the security forces had cordoned off the area and arrested two of the gunmen.
In the past few weeks, rebels have launched major attacks on markets across Iraq, causing heavy civilian casualties, with many appearing to be sectarian in nature.
Both Sunni insurgents like al-Qaeda and Shi’ite militias have been active in the area.
The local population is mixed between the two Muslim sects whose violent differences have taken Iraq to the brink of civil war.
The attack came on the anniversary of the 1968 coup d’etat that brought Saddam Hussein’s Sunni-dominated Baath party to power.
In an earlier attack, a suicide bomber detonated explosives inside a cafe packed with Shi’ites in northern Iraq on Sunday, killing 26 people and injuring 22.
Witnesses said the blast was so powerful that it collapsed the ceiling of the one-storey cafe, burying many of the victims.
Hours after the blast, rescuers were still sifting through the debris looking for the dead or injured.
In Baghdad, gunmen seized a senior Iraqi Oil Ministry official in the second high-profile kidnapping in the Iraqi capital in as many days.
Attackers stopped Adel Kazzaz, director of the North Oil Co, shortly after he left the Oil Ministry in eastern Baghdad, ministry spokesman Assem Jihad said.
Gunmen who seized up to 31 people in a daylight raid on a Baghdad club on Saturday released six of their hostages yesterday.
There was no word on the other hostages, including the Olympic National Committee chairman, Ahmed al-Hijiya.