BAGHDAD (AP) — Iraq on Wednesday reiterated its demand that Turkish troops withdraw from a northern camp where they are training anti-Islamic State fighters, warning that it will consider military action if the soldiers remain.

The dispute flared up in early December after Turkey deployed reinforcements to a camp in northern Iraq's Bashiqa region where Ankara is helping to train Sunni and Kurdish fighters to battle IS.

The deployment riled Baghdad, which considers the new troops an illegal incursion and has demanded their immediate and complete withdrawal. Turkey has begun withdrawing troops, but some remain.

Iraqi Foreign Minister Ibrahim al-Jaafari told a press conference Wednesday that Baghdad will continue to pursue a peaceful resolution, but warned that if "fighting is imposed on us, we will consider it to protect our sovereignty, people and resources."

The Islamic State group seized much of northern and western Iraq, including the second largest city, Mosul, in the summer of 2014. The extremists have declared a caliphate in the areas of Iraq and Syria under their control and have imposed a harsh and violent version of Islamic law.

On Monday, Iraqi forces backed by U.S.-led airstrikes drove IS militants out of the city center of Ramadi, the capital of the western Anbar province, and raised the Iraqi flag over the main government complex there.

IS had seized Ramadi in May, in its biggest advance since the start of a U.S.-led air campaign in August 2014.

Gen. Ismail al-Mahlawi, the provincial military commander, said operations were paused in Ramadi on Wednesday due to rainy weather. IS militants still control around 30 percent of the city.