More than 100 people were killed in a suicide car bombing at a busy market in an Iraqi town on Friday, in one of the deadliest attacks carried out by Islamic State militants since they overran large parts of the country.

The blast brought down several buildings in Khan Bani Saad, about 30 km (20 miles) northeast of Baghdad, crushing to death people who were celebrating the end of the Muslim fasting month of Ramadan, police and medics said.

Islamic State, which controls large parts of northern and western Iraq claimed responsibility for the attack in the mixed eastern province of Diyala where Khan Bani Saad is located and said the target was "rejectionists", as the group refers to Shi'ite Muslims.

Angry crowds went on the rampage after the explosion, smashing the windows of cars parked in the street in grief and anger. Body parts were flung onto the roofs of nearby buildings by the force of the blast, police said.

"Some people were using vegetable boxes to collect children's body parts," said police major Ahmed al-Tamimi from the site of the explosion, describing the damage to the market as "devastating".

An officer from the Diyala police command said rescue crews were still retrieving bodies from under the debris so the death toll could rise.

The Diyala provincial government declared three days' mourning and ordered all parks and entertainment places to close for the rest of the Eid al-Fitr holiday to pre-empt any further attacks.

Islamic State said in a statement issued on Twitter that the attack was to avenge the killing of Sunni Muslims in the northern Iraqi town of Hawija, and that the suicide car bomber was carrying around three tonnes of explosives.

Iraqi officials declared victory over Islamic State in Diyala earlier this year after security forces and Shi'ite paramilitaries drove them out of towns and villages there, but the insurgents remain active in the province.

Security forces and militia groups are currently focused on the western province of Anbar, where they have been gearing up for an offensive to retake the mainly Sunni governorate - Iraq's largest.

The United Nations said earlier this week that nearly 15,000 people had been killed in the 16-month period up to April 30.