"Nowadays, there is some negative progress in Syria. If that would cause any threat to our borders, the world should know that we would react the same as we did in Operation Euphrates Shield," Erdogan said during a speech in the southeastern province of Sanliurfa late Friday.
Turkey launched Operation Euphrates Shield last August to wipe out the Islamic State (IS) militants and stop the advance of Syrian Kurds in northern Syria. The operation ended in late March.
"In case of even the slightest threat against our country, we will do what's necessary without consulting anyone," Erdogan said.
The president also warned the United States to cut its ties with the People's Protection Units (YPG).
"We told our strategic allies to build cooperation with us in the fight against IS but they choose to operate with terror groups," he said.
Turkey considers the YPG Syrian affiliates of the Kurdistan Workers' Party (PKK), which is designated as a terrorist organization by Turkey, the U.S. and European Union.
However, the US supports the YPG as its ally on the ground in combating the IS in Syria, a policy that has caused tensions between Washington and Ankara.
This story was first published in the Global Times.