China is committed to peace but will not give up "even one inch" of territory, President Xi Jinping has said, after talks with visiting US Defence Secretary James Mattis.
Tensions between both countries are mounting over trade hostilities and China's increasingly assertive claims to territory in the South China Sea.
Mr Mattis is the first Pentagon chief to visit China since 2014.
It's part of a trip across Asia, meeting several regional US allies.
Mr Mattis said his talks with Mr Xi in Beijing and other officials on Wednesday had been "very, very" good, adding that the US was assigning a "high degree of importance to the military relationship" with China.
Mr Xi added that China had peaceful intentions, but reasserted his view that there would be no concessions from China about what it considers to be Chinese territory.
"We cannot lose even one inch of the territory left behind by our ancestors," Mr Xi said, according to Chinese state media. "What is other people's we do not want at all."
The US has repeatedly criticised China's movements in the South China Sea, accusing it of intimidating its neighbours and militarising the area, by building up facilities on artificial islands.
Several countries have competing claims in the disputed sea, but China claims the largest portion of territory, saying its rights go back centuries.
The area is a major shipping route, and a rich fishing ground, and is thought to have abundant oil and gas reserves.
The defence secretary's tour comes after a historic summit in Singapore which saw US President Donald Trump meet North Korean leader Kim Jong-un.
After Beijing, he will travel on to South Korea and Japan, where he is expected to pass on reassurances about the US post-summit security commitment to the region.