BAGHDAD -- The extremist Islamic State group claimed responsibility Sunday for a late-night car bomb attack in the heart of Baghdad that killed at least 19 people, saying it was targeting a Shiite militia.

The extremist group, however, did not shed any light on accusations by Yazidi lawmakers that it had executed at least 25 prisoners of the minority community in the northern city of Tal Afar.

The two car bombs in Baghdad went off about 10 minutes apart late Saturday in the Karrada district, known for its restaurants, cafes and ice cream parlours. Police said the dead and wounded were mainly shoppers and people commemorating the birth of Imam Ali, a key figure in Shiite Islam. Two traffic policemen were among those killed.

The online claim is similar to others the group has issued this past week about bombings in Baghdad, which they describe as revenge for the fighting in nearby Anbar province.

Iraqi forces are engaged in a see-saw battle in Anbar against Islamic State militants, who control some 65 per cent of the province. The fighting has caused 114,000 residents of the regional capital to flee to Baghdad.

At the same time, there has been a major spike in car bombs in Baghdad over the past week, leading some Iraqi officials to claim that militants have infiltrated the capital by hiding among the displaced.

Yazidi lawmakers are meanwhile looking into reports of the killing of prisoners.

The Yazidis are tiny religious community that was directly in the path of the Islamic State when it swept through northern Iraq last year. Hundreds are believed to have been taken captive and the women sold to fighters as slaves.

The alleged killings took place at a prison camp near the town of Tal Afar, some 150 kilometres east of the Syrian border, legislator Mahma Khalil said. He said he believes some 1,400 other Yazidis are still held in the camp.