ISTANBUL (Reuters) - Turkish forces retaliated with an artillery barrage overnight and destroyed Kurdish YPG militia targets after the group’s fighters opened fire on Turkey-backed forces in northern Syria, the military said on Wednesday.

FILE PHOTO: A general view shows the Kurdish city of Afrin, northwest Syria March 18, 2015. REUTERS/Mahmoud Hebbo/File Photo

It said Turkish warplanes separately struck Kurdish militants in northern Iraq on Wednesday, killing seven fighters from the PKK group which Ankara says is closely linked to the YPG.

The strikes came after Turkey’s defense minister warned that Ankara would retaliate against any threatening moves by the YPG and after reports that Turkey was reinforcing its military presence in northern Syria.

The United States supports the YPG in the fight against Islamic State in Syria, while NATO ally Turkey regards them as terrorists indistinguishable from militants from the outlawed PKK which is carrying out an insurgency in southeast Turkey.

Turkey’s army said YPG machine-gun fire on Tuesday evening targeted Turkey-backed Free Syrian Army elements in the Maranaz area south of the town of Azaz in northern Syria.

“Fire support vehicles in the region were used to retaliate in kind against the harassing fire and the identified targets were destroyed/neutralised,” the military statement said.

The boom of artillery fire could be heard overnight from the Turkish border town of Kilis, broadcaster Haberturk said. It was not clear whether there were casualties in the exchange of fire.

Ankara was angered by a U.S. decision in June to arm the YPG in the battle for Islamic State’s Raqqa stronghold. President Tayyip Erdogan said on Sunday that nations which promised to get back weapons from the YPG once Islamic State were defeated were trying to trick Turkey.

U.S. Defense Secretary Jim Mattis on Tuesday left open the possibility of longer-term assistance to the YPG, saying the U.S. may need to supply them weapons and equipment even after the capture of Raqqa.

Ankara considers the YPG as an extension of the Kurdistan Workers Party (PKK), which is deemed a terrorist group by Turkey, the United States and the European Union.

The PKK has carried out an armed insurgency against the Turkish state since 1984 and more than 40,000 people, most of them Kurds, have died in the fighting.

Turkish warplanes on Wednesday morning destroyed PKK shelters and gun positions during air strikes in the Avasin-Basyan area of northern Iraq, killing seven militants planning an attack on Turkish border outposts, an army statement said.

Faced with turmoil across its southern border, Turkey last year sent troops into Syria to support Free Syrian Army rebels fighting both Islamic State and Kurdish forces who control a large part of Syria’s northern border region.

Erdogan has said Turkey would not flinch from taking tougher action against the YPG in Syria if Turkey believed it needed to.