Turkey's military conducted air strikes in northern Iraq and staged several raids across the country this week in response to the attack, detaining dozens suspected of alleged links to the outlawed Kurdistan Workers Party (PKK).

Foreign Minister Hakan Fidan said the attackers had entered Turkey through Syria and received training there, adding the Turkish response would be "very precise".

"All infrastructure, superstructure and energy facilities that belong to the PKK and the YPG, especially in Iraq and Syria, are legitimate targets of our security forces, armed forces and intelligence units from now on," he said.

Turkey has carried out several cross-border incursions into northern Syria in recent years targeting the YPG militia that it sees as an affiliate of the PKK, which is now based in northern Iraq.

The YPG is also the spearhead of the main ally of the U.S.-led coalition against Islamic State. Support for the YPG by the United States and other allies, including France, has strained ties with Ankara.

"I recommend from here that third parties stay away from the facilities and people belonging to the PKK and the YPG," Fidan said in an apparent reference to U.S., Russian and French troops in the region.

Broadcaster Haberturk and other Turkish media reported Wednesday that Iraqi Defence Minister Thabet al-Abbasi would visit Ankara on Thursday to meet with Turkish counterpart Yasar Guler, after Iraq denounced Ankara's air strikes this week.

(Reporting by Tuvan Gumrukcu, Writing by Huseyin Hayatsever; Editing by Jonathan Spicer)