Baghdad (AFP) - Jihadist gunmen and bombers killed at least 12 people in a busy market area of Baghdad while a double blast at a cafe north of the Iraqi capital claimed another 20 lives.

An attack claimed by the Islamic State group and involving suicide explosions, gunfights and hostage-taking wreaked chaos in the eastern neighbourhood of Baghdad al-Jadida.

"A car came... gunmen came out of it and spread out. They started shooting, killing people, there were lots of dead people," said a witness, Salman Hussein.

The shocked young man recounted how one of the attackers held a shop owner and spoke on a mobile phone before detonating his suicide belt.

"The car they came in was laden with explosives and also blew up," he said.

The head of Baghdad Operations Command, Lieutenant General Abdelamir al-Shammari, insisted to reporters on the scene that the situation was quickly brought under control.

He denied reports by several officials in the Baghdad police and in the interior ministry that the attackers held several people hostage in the nearby Zahrat Baghdad mall.

But a senior police officer gave a different account, saying the attackers sprayed gunfire and blew up a car bomb on the street before entering the mall and taking hostages.

"When the security forces got too close, they killed three hostages," he said. Several other sources gave a similar account.

The sequence of the attack, a departure from Islamic State's usual modus operandi in Baghdad, remained unclear and the statement posted by the jihadists online provided few details.

It said the attack was carried out by "four soldiers of the caliphate" and targeted Shiites.

It said one of the IS members blew himself up in an explosives-laden vehicle when "the apostates sent reinforcements".

IS claimed that a total of 90 people were killed or wounded, but the group has previously exaggerated the number of casualties caused by its attacks.

- Diyala bombings -

"These people were shooting everywhere, there was even one guy with an RPG (rocket-propelled grenade launcher)," said Fadhel, another witness from Shiite neighbourhood Baghdad al-Jadida.

Story continues

"I saw the body of a small child strewn on the ground over there... What were the sins these people committed to deserve this?" he said.

Police and hospital sources put the casualty toll from the attack, one of the worst to hit Baghdad in months, at 12 dead and more than 30 wounded.

Almost simultaneously, bombings killed at least 20 people at a cafe in the town of Muqdadiyah northeast of Baghdad, security officers said.

A bomb exploded at the cafe and a suicide bomber detonated an explosives-rigged vehicle after people gathered at the scene, a police captain and an army colonel said.

IS also claimed the Muqdadiyah attack and named the suicide bomber as Iraqi Abu Abdallah.

The US condemned both attacks as "barbaric acts of terrorism", which it said "once again display the utter disregard ISIL has for the lives of innocent civilians", using a different name for IS.

The European Union said it supported Baghdad, stressing that "these tragic events underline the fragility of the security situation" in Iraq.

The mixed province of Diyala, where Muqdadiyah is located, was declared liberated by the government almost a year ago but attacks have continued.

Iraq's intelligence services announced on December 24 they had dismantled a major IS cell and made 40 arrests in Baghdad and Diyala.

At least three people were killed and eight wounded in another car bomb blast in Nahrawan, south of Baghdad.

Monday's combined attacks made for one of the worst days of violence in months in areas that are not active front lines.

IS has suffered a number of military setbacks across Iraq in the past year. Security officials say fierce battles and relentless air strikes have depleted its manpower.

Analysts see that as a reason for the drop in attacks targeting civilians in the capital, which were an almost daily occurrence two years ago.