By Orhan Coskun and Nick Tattersall
ANKARA/ISTANBUL (Reuters) - Smarting over exclusion from an Iraqi-led offensive against Islamic State in Mosul and Kurdish militia gains in Syria, President Tayyip Erdogan warned on Wednesday Turkey "will not wait until the blade is against our bone" but could act alone in rooting out enemies.
In a speech at his palace, Erdogan conjured up an image of Turkey constrained by foreign powers who "aim to make us forget our Ottoman and Selcuk history", when Turkey's forefathers held territory stretching across central Asia and the Middle East.
"From now on we will not wait for problems to come knocking on our door, we will not wait until the blade is against our bone and skin, we will not wait for terrorist organizations to come and attack us," he told hundreds of "muhtars", local administrators generally loyal to the government.
"Whoever supports the divisive terrorist organization, we will dig up their roots," he said, referring to Kurdish PKK militants who have waged a three-decade insurgency against Turkey and have bases in northern Iraq and affiliates in Syria.
"Let them go wherever until we find and destroy them. I am saying this very clearly: they will not have a single place to find peace abroad."
Erdogan has struck an increasingly belligerent tone in his speeches in recent days, frustrated that NATO member Turkey has not been more involved in the U.S.-backed assault on Mosul, and angered by Washington's support for Kurdish militia fighters battling Islamic State in Syria.
He is riding a wave of patriotism since a coup attempt failed to oust him in July, his message of a strong Turkey playing well with his fervent supporters.
Ankara has been locked in a row with Iraq over the presence of Turkish troops at the Bashiqa camp near Mosul, as well as over who should take part in the offensive in the largely Sunni Muslim city, once part of the Ottoman empire and still seen by Turkey as firmly within its sphere of influence.
Erdogan has warned of sectarian bloodshed if the Iraqi army relies on Shi'ite militia fighters.
He said agreement had been reached with the U.S. military on Turkish jets joining the Mosul operation, although Washington has said it is up to the Iraqi government on who takes part.
"They thought they could keep us out of Mosul by bothering us with the PKK and Daesh (Islamic State) ... They think they can shape our future with the hands of terrorist organizations," he said. "We know that the terrorists' weapons will blow up in their hands soon."
"YOU ARE FOREIGNERS HERE"
Turkey has felt increasingly powerless to control events across its borders as the U.S.-led coalition focuses on fighting Islamic State in Syria rather than on removing Syrian President Bashar al-Assad, the root cause of the war in Ankara's view.
It has been particularly angered by U.S. support for Kurdish militia fighters in Syria. Washington views the Kurdish YPG as useful allies in the fight against the jihadists, but Turkey sees them as a hostile force and an extension of the PKK.
"We know this business in this region. You are foreigners here. You do not know," Erdogan said, to loud applause, in a speech on Tuesday to mark the opening of the academic year.
While criticizing the West, the Turkish leader has restored ties with Moscow in recent weeks, vowing to seek common ground on Syria after a meeting with Russian President Vladimir Putin last week, despite Moscow's backing of Assad.
Erdogan said he discussed with Putin by phone an agreement on Tuesday night on removing from Aleppo the group formally known as the Nusra Front, and now called Jabhat Fatah al Sham. He gave no details.
Erdogan has made repeated references in his speeches this week to the term "Misak-i Milli" or National Pact, referring to decisions made by the Ottoman parliament in 1920 setting out the borders of the Ottoman Empire.
He often laments the concessions made by Turkish leaders after World War One, with the signing of the Treaty of Lausanne that brought modern Turkey into being in 1923. Pro-government media this week published maps depicting Ottoman borders encompassing an area including Mosul.
He warned of efforts to "restructure the region" and said Turkey would not sit by.
"I'm warning the terrorist organizations, the sectarian fanatic Baghdad government, and the Assad government that kills its own people: you are on the wrong path. The fire you are trying to start will burn you more than us," Erdogan said.
"We are not obliged to abide by the role anyone has set for us in that sense. We have started carrying out our own plan."
(Additional reporting by Tuvan Gumrukcu in Ankara and Daren Butler in Istanbul; Writing by Nick Tattersall; editing by Ralph Boulton)