The attack in Dujail, in Salahuddin province, was one of the deadliest in Iraq in months and shows militants are still capable of carrying out large-scale bombings despite major security gains across the country.
Major Ahmed Subhi, head of an anti-terrorism unit in the province, told Reuters that 30 people were killed and 47 wounded.
Some officials said the attack was carried out by a suicide bomber although witnesses said it was a parked vehicle.
Police said the bombing occurred just before dusk, when many people were on the streets before breaking their daily fast during the holy Muslim month of Ramadan.
They said casualties were a mix of civilians shopping at a nearby market as well as police.
Dujail lies 50 km (30 miles) north of Baghdad.
The attack bore the hallmarks of Sunni Islamist al Qaeda.
Violence overall in Iraq has fallen to levels not seen since early 2004. Those security gains have allowed U.S. forces to begin withdrawing from Iraq.
Dujail was the site of an assassination attempt on former Iraqi leader Saddam Hussein in 1982.
Saddam, toppled in the U.S.-led invasion in 2003, was hanged in December 2006 after being found guilty in the killing of scores of Shi'ite men in Dujail after the attempt on his life.