China will not give up "any inch of territory" in the Pacific Ocean, President Xi Jinping told US Defense Secretary James Mattis Wednesday during a visit to Beijing.

When Defense Secretary Jim Mattis met with President Xi Jinping of China on Wednesday, he hoped to start a conversation on China’s position in the South China Sea. He left knowing just how firm Mr. Xi is on the issue.

“We cannot lose even one inch of the territory left behind by our ancestors,” Mr. Xi told him, according to Chinese state media. “What is other people’s, we do not want at all.”

During a meeting with his counterpart, Gen. Wei Fenghe, Mr. Mattis reminded the general of Mr. Xi’s remarks during a 2015 White House visit when Mr. Xi said he had “no intention to militarize” islands in the South China Sea, according to the officials.

At a conference in Singapore this month, Mattis accused China of “intimidation and coercion” for placing surface-to-air missiles and other military equipment on islands in the South China Sea, many of which are also claimed by Taiwan, Vietnam, the Philippines and Malaysia.

Disagreements between Washington and Beijing over the Chinese military’s expanding presence in the South China Sea and the American policy toward Taiwan were two of the most prominent issues raised during meetings between Mr. Mattis and senior officials in Beijing, the first stop on a trip that will take him to South Korea and Japan.

Mr. Mattis, who has assailed the Chinese military for its expansion in the South China Sea, made clear the Pentagon’s stance on contested waters, stressing the need for freedom of navigation in the region and China’s adherence to international law, according to defense officials who spoke on condition of anonymity.

The Trump administration took office with officials hinting at stronger support for Taiwan, a self-governing democracy that China considers part of its territory, though the Communist government has never controlled the island. Congress has also pressed the administration to do more, passing a Taiwan Travel Act that authorized the White House to increase contacts and trade.

While the administration has offered a package of arms sales and opened up the possibility of sharing submarine technology, it has stopped far short of any actions that would provoke Beijing.