Chinese President Xi Jinping and Turkey's Recep Tayyip Erdogan have pledged to strengthen ties between the two countries to fight terrorism as they gather in China for the G20 Summit starting on Sunday (4 September).

Xi told Erdogan that he appreciated Ankara's emphasis that it would not allow its country to take any actions that would affect China's security. The presidents met on the sidelines of the economic summit on Saturday.

China "hopes both sides can achieve even more substantive results in counter-terrorism cooperation", Reuters quoted Xi as saying. China is Turkey's third-largest trading partner.

Erdogan said: "Fighting terrorism is a long-term issue, and is also a long-term topic discussed by the G20." He insisted on boosting ties with his Chinese counterpart and thanked Beijing for its support in upholding Ankara's security and stability.

Turkey and China are reported to have set aside their differences for the weekend summit as they had fallen out in the past over China's alleged handling of Muslim minorities of Uighur who regard themselves as culturally and ethnically related to Turkey.

Discord between indigenous Uighurs community in China and the authorities have had a long history. The ethnic minorities are said to be mostly the followers of Islam religion – largest group of Muslims in China - and speak a language that is close to Turkish.

Hundreds or thousands of them fled China as the government reportedly ignored recognising their culture and language. China also allegedly had a harsh crackdown on Islamic traditions in the country. It included banning the Muslim Uighurs from fasting during the holy season of Ramadan, barring mosques from calls to prayers and restricting minors from entering the mosque.

Following years of unrest in China's western Xinjiang region, the Uighurs escaped to Turkey. Beijing has accused them of their alleged involvement in fighting militants in Syria and Iraq.

Turkey even angered China for expressing concern about Beijing's treatments of Uighurs. Several Turkish protesters marched on China's embassy and consulate in Turkey over the issue.

Last year, Turkey pledged to accept into its country the Uighur migrants fleeing what rights activists have called religious persecution in China.