ANKARA/BAGHDAD (Reuters) - Sources in northern Iraq said on Friday Kurdish PKK guerrillas would withdraw from the Sinjar area, after Turkey threatened cross-border military action against them there.

The Kurdistan Workers Party (PKK) has waged an insurgency against the Turkish state for decades. President Tayyip Erdogan said on Monday they were creating a new base in Sinjar, and warned Turkish forces would attack if necessary.

The PKK gained a foothold in Sinjar in 2014 after it came to the aid of the Yazidi minority community, who were under attack by Islamic State militants.

“Guerrilla forces intervened in Sinjar in order to rescue the Yazidis from genocide. With the confidence of reaching this goal, guerrilla are withdrawing from Sinjar,” said a statement on Friday from the Kurdistan Communities Union (KCK), an umbrella group of Kurdish organizations.

It was unclear when the guerrilla withdrawal would actually begin, and a source in the region said local groups affiliated to the PKK would maintain a presence in Sinjar.

A source in the Sinjar Resistance Units (YBS), a local ally of the PKK, said the withdrawal would happen soon.

The PKK, considered a terrorist organization by Turkey, the European Union and United States, has for decades been based in the Qandil mountain range near Iraq’s border with Iran. Erdogan alleged on Monday a “second Qandil” was being established in Sinjar, further west.

Erdogan said Turkey had demanded that the Iraqi government clear the area of militants, and warned that Turkish forces would launch a military offensive “if this issue is prolonged much longer”.

Turkish forces are currently pressing an offensive against Kurdish fighters in northwest Syria. Erdogan said the campaign could be extended along the length of Turkey’s border with Syria, and if necessary into northern Iraq.

Sinjar lies in disputed, ethnically mixed territory. After the fall of Saddam Hussein in 2003, the area came under control of Kurdish government forces but was claimed by Baghdad.

In October, Iraqi government forces launched an offensive to retake the area in response to a Sept. 25 referendum on Kurdish independence, which Baghdad opposed.

Iraqi forces, including Iran-backed Shi’ite militias, have since shared control of the Sinjar area with KCK-affiliated groups, in a largely peaceful but uneasy alliance.