BAGHDAD (Reuters) - Eight people were killed in two car bombings in the Iraqi city of Falluja west of Baghdad on Sunday, police and hospital sources said, and a news agency close to Islamic State said its militants carried out the attacks.

The bombings took place as Iraqi forces wage an eight-week military campaign to crush Islamic State in its north Iraq stronghold of Mosul, the largest city in its self-declared caliphate in Iraq and Syria.

The fact that the jihadist group was able to carry out the attack in Falluja, which the Iraqi army recaptured in June, suggests it will continue to pose a threat in Iraq even if it is finally crushed in Mosul.

The sources said a suicide bomber detonated a car at a security checkpoint in the west of the city, and a second bomb in a parked car struck the center, near a security checkpoint and a busy cafe.

Sources at the hospital where casualties from both incidents were brought said eight bodies were delivered to the hospital.

The Amaq news agency, which is close to Islamic State, said both attacks were carried out by suicide car bombers.

The attacks in Falluja occurred on the day that U.S. Defense Secretary Ash Carter visited Iraq for talks with political leaders and the U.S. commander of the international coalition force supporting them in the grueling Mosul campaign.

Elite Iraqi counter terrorism forces have taken about a quarter of the city of Mosul from Islamic State fighters, but they have faced fierce counter attacks from snipers, mortar barrages and hundreds of suicide car bombs.

Insurgents in Falluja, the first Iraqi city to fall to Islamic State in January 2014, put up only limited resistance in June, military officials said at the time, in contrast to the fierce defense the jihadists have put up in Mosul.