The military exercise was cancelled after U.S. President Donald Trump's summit with North Korean leader Kim Jong Un.
Relations between Washington and Beijing have been marred recently by rising tensions - not only by an impending trade war but also by both militaries viewing each other with increasing suspicion.
But in an indication of the wide gap that remains, China issued a warning that "any inch of territory passed down from ancestors can not be lost while we want nothing from others", Xinhua news agency later reported Xi told Mattis.
During a meeting inside Beijing's Great Hall of People, Xi told Mattis that while China had only peaceful intentions and would not "cause chaos", there can be no concessions on on territorial issues.
Mattis is in Beijing as tension between the two countries mount over a looming trade war and China's assertive claims on territorial rights in the dispute-ridden South China sea.
USA officials said the talks included passing reference to the trade war brewing with China, as new US tariffs are poised to take effect and Beijing promises to strike back at the USA economy.
Dana White, chief Pentagon spokeswoman, said the talks touched on issues including Washington's condemnation of the placement of Chinese military assets in areas of the South China Sea also claimed by US allies in the region.
Taiwan, the other contested area Xi mentioned in his statement, is considered to be a renegade province and the subject is a sensitive one for China.
The US has a 32,000-strong force in South Korea, according to Trump.
Mattis said discussions will focus on the "way ahead" with the goal of North Korean denuclearization and other issues of cooperation between United States and South Korean militaries, following the the U.S. suspension of military exercises after the Singapore summit. While both sides acknowledged points of friction, they also sought to focus on areas of alignment-including a shared goal of denuclearization of the Korean peninsula.
Ahead of Mattis and Xi's meeting, Professor Steve Tsang, a political scientist and director of the SOAS China Institute, told Newsweek that "there's no way they would bridge their differences" in the South China Sea.
He is the first Pentagon chief to visit China since 2014, and also held meetings with his Chinese counterpart Wei Fenghe and other top generals.
He added that Defence Minister Wei has accepted an invitation from Mattis to visit the United States this year.
"The key part is solving the issues between the USA and China with mutual respect".
But speaking at a monthly news briefing, Chinese Defence Ministry spokesman Wu Qian said the two countries had reached an "important consensus" on mutual trust, further exchanges, cooperation and managing and controlling risks and challenges.
The Chinese government appeared to take umbrage at the characterization of it as a revisionist power threatening the United States, laid out in a National Defense Strategy unveiled by Mattis earlier this year.
Mattis was expected to leave for Seoul later Thursday, where he would likely encounter questions about Trump's decision to halt joint military drills with South Korea.
His message appeared aimed at putting to rest any rumblings that the USA would pull its forces off the peninsula - a possibility that gained momentum when President Donald Trump said after his June 12 summit with North Korean leader Kim Jong Un that he'd like to remove all 28,500 US troops from South Korea.