Mr Mattis said Beijing was intimidating and coercing others in the region by putting weapons systems on manmade islands. It was not immediately clear whether that invitation would stand after the conference.
Reuters first reported that two U.S. Navy warships sailed near South China Sea islands claimed by China on Sunday. Singapore has warned previously that countries should not be squeezed by competition between the USA and a rising China, or forced to take sides.
Mattis responded that the question reflected a fundamental disconnect with the way global tribunals have spoken on the matter.
China and the United States shoulder important responsibilities in maintaining regional and global peace, He was cited as saying by Xinhua news agency.
In an exchange with Mattis, Senior Colonel Zhao Xiaozhuo, deputy director of the Center on China-US Defense Relations in the PLA's Academy of Military Science, said that sending warships into Chinese territorial waters was a violation of the country's law.
Discussion about the number of U.S troops in South Korea is subject to bilateral discussions between Washington and Seoul that are separate from the North Korea negotiations, Mattis said.
The U.S. Department of Defense is also committed to working with Taiwan so the self-ruled island can maintain sufficient self defense, the defense secretary continued.
Despite strong mutual suspicions, the United States had included China in the past two versions of the naval exercise known as Rim of the Pacific, or RimPac, in 2014 and 2016.
US Defence Secretary Jim Mattis warned in Singapore on Saturday that China's militarization of the South China Sea was now a "reality" but that Beijing would face unspecified consequences.
SpaceX to launch SES-12 communications satellite
Falcon 9's first stage for the SES-12 mission previously supported the OTV-5 mission from Launch Complex 39A in September 2017. SES-12, the 13th satellite built by Airbus for SES , has been successfully launched from Cape Canaveral, Florida on 04 June.
Trump under fire for tweet about jobs report
Trump supporters say the president's economic plan and hard-bargaining with other countries is paying dividends for US workers. In the span of time between when Trump posted his tweet and when the jobs report was released, US treasury yields shot up.
Commerce Secretary Ross Brings EU to the Negotiating Table with Tariff Threats
Europe did not want a trade war, he said, but Washington had to back down from "unjustified, unjustifiable and unsafe tariffs". We didn't lose textile jobs to Mexico or Canada, we lost them to countries we didn't have trade agreements with.
"Our Indo-Pacific strategy informs our relationship with China", Mattis said.
As expected, the Pentagon chief gave only a brief mention of the ongoing negotiations for an historic summit later this month between President Donald Trump and North Korean leader Kim Jong Un. He Lei was quoted by AFP as saying that "Any irresponsible comments from other countries can not be accepted".
Mattis also criticized China's "Belt and Road" initiative without explicitly naming the program, saying that Beijing has to rethink twice if they believe "piling mountainous debts on their neighbors and somehow removing the freedom of political action is the way to engage with them". It was the latest freedom of navigation operation created to challenge Beijing's claims.
It has begun building military structures on disputed islands - much to the dismay of other South-East Asian nations including the Philippines, Indonesia, Malaysia, Taiwan and Vietnam. China protested the move.
Beijing sent a relatively low-level delegation to this year's Shangri-La forum, which was dominated by the USA and its allies.
At the same news conference, ministry spokesman Ren Guoqiang also confirmed China's development of its latest-model type 055 guided missile destroyer, which weighs 10,000 tons and features both stealth design and a land-attack capability.
The French Minister of Defense, Florence Parly, said she welcomes the signs of dialogue, but added that sanctions should continue until denuclearization is achieved in a full, verifiable and irreversible manner.
But Mr Mattis also said the USA welcomed cooperation with China "wherever possible", and announced that he had accepted Beijing's invitation to visit soon.