Chinese President Xi Jinping told US Defense Secretary James Mattis Wednesday that China has no plans to create chaos in the world -- although he defended his country's claim to disputed islands in the South China Sea.

Answering Mattis's open questions about China's strategic intentions, amid rising tensions between the two countries, Xi stood firm on the Beijing's occupation of small islands in the center of Southeast Asia, where it has installed modern weapons systems, runways and aircraft hangers.

‘Chinese people must build a strong socialist modernised country, but we insist on taking the path of peaceful development. We will not follow the path of expansionism and colonialism, we will not bring chaos to the world,’ Xi told the visiting Pentagon chief.

But Xi, quoted by Xinhua news agency, added: ‘While seeing the existing common interests of China and the United States, we also do not shun the differences that exist between the two sides.’

‘Regarding the issue of China's sovereignty and territorial integrity, our attitude is firm and clear. From the territory left by our ancestors, (we will not) give up even one inch.’

Xi's comments were a direct rebuff to Mattis's criticism at a security conference in early June, where he had accused the Chinese leader of reneging on a promise not to place weaponry on the built-up atolls in the South China Sea that Beijing says are historically Chinese.

Beijing has installed missile batteries and recently landed long-range bombers on some of the reclaimed outposts.

- 'Intimidation and coercion' -

China claims almost the entire resource-rich sea, through which $5 trillion in shipping trade passes annually, with competing claims from Brunei, Malaysia, the Philippines, Taiwan and Vietnam.

Mattis had said China's actions were aimed at ‘intimidation and coercion’ in the Southeast Asian region.

The Pentagon chief arrived in Beijing late Tuesday for talks with his Chinese counterparts and Xi aimed at taking a measure of China's global security ambitions.

Mattis, who had never been to China before and had not met recently appointed defense minister Wei Fenghe, said that despite some glaring differences, including Beijing's increased pressure on US ally Taiwan, and soaring trade tensions, he had hoped to find some common ground that could foster military-to-military cooperation.

Over the long run, that could be a stabiliser as the two superpowers compete for strategic position in the Indo-Pacific region.

‘Ï'm here to keep our relationship on the right trajectory, keep it going in the right direction and to share ideas with your military leadership, as well as look at the way ahead,’ he said at the outset of his meeting with Xi.

Xi echoed those sentiments, urging more cooperation and communication between the two countries' armed forces.

‘The Chinese-US relationship is one of the most important bilateral relationships in the world,’ Xi said. ‘The common ground of the two parties far exceeds the differences.

‘In recent years, the relations between the two armies have maintained a good momentum,’ he told Mattis.

‘Since ancient times, to know the art of war is not to like doing war; strengthening exchanges and mechanisms at all levels between the two armed forces will help to dissipate misgivings and to prevent misunderstandings, miscalculations and accidents.’

But he was also clear that China was not going to back off its controversial territorial claims, which have upset countries in Southeast Asia which see China encroaching their own territory.

- No comments on North Korea -

Before seeing Xi, Mattis spent the day in meetings with other top Chinese officials, including Defence Minister Wei Fenghe and Politburo member and former ambassador to the United States Yang Jiechi.

Mattis was greeted at the headquarters of the People's Liberation Army by an honour guard and marching band playing the US and Chinese anthems.

Besides hoping to strengthen military ties, Mattis had been expected to discuss ways China and the United States could maintain pressure on North Korea to persuade it to give up its nuclear weapons.

China is Pyongyang's closest ally and Washington sees its cooperation in preserving an economic embargo on North Korea as crucial.

Mattis will continue meeting Chinese officials through Thursday morning, and then fly to Seoul and Tokyo. He will reaffirm the US security commitment to its East Asian allies amid some nervousness about Trump's embrace of North Korean leader Kim Jong Un.