The two countries have sparred in the past over Beijing's treatment of the mostly Muslim Uighur minority.
The two countries have sparred in the past over Beijing's treatment of the mostly Muslim Uighur minority in China's far western region of Xinjiang, who have cultural ties with Turkey and speak a Turkic language.
"We treat China's security as our own security," Turkish Foreign Minister Mevlut Cavusoglu told reporters in Beijing during a joint press conference with his Chinese counterpart.
"We absolutely will not allow any activities opposing or aimed against China within Turkey or its territories, and we will take measures to eliminate any media reports aimed against China."
Cavusoglu's remarks followed a meeting with Chinese Foreign Minister Wang Yi in which both sides vowed to work together to combat terrorism.
Beijing blames unrest in Xinjiang on Islamist separatists seeking independence for the region, while Turkey in the past repeatedly expressed concerns about Beijing's treatment of the minority -- with Erdogan even accusing Beijing of "genocide" in the region.
But ties have warmed as Turkey has sought to pivot away from the West and toward Asia, seeing in China a wealth of economic possibilities.
As part of China's expansive Belt and Road initiative, an economic corridor will be established between the two countries, as well as a highspeed rail linking the eastern and western regions of Turkey.
"We greatly praise China for the work it has done so far to tackle the issues confronting Islamic countries," Cavusoglu said Thursday.