They carried out maneuvering-operations near Tree, Triton and Woody islands.
While this operation had been planned months in advance, and similar operations have become routine, it comes at a particularly sensitive time and just days after the Pentagon uninvited China from a major US-hosted naval drill.
The operation was the latest attempt to counter what Washington sees as Beijing's efforts to limit freedom of navigation in the strategic waters.
The US military conducts what it calls "freedom of navigation" voyages in the South China Sea to contest Beijing's assertion of territorial rights in the area, although the US has no claims of its own in the disputed region.
The ministry said the course plotted by the vessels had "seriously infringed upon Chinese sovereignty" and "contravened Chinese and relevant global law", as they had entered territorial waters without permission.
In a separate statement, China's foreign ministry urged Washington to stop such actions.
'China will continue to take all necessary measures to defend the country's sovereignty and security, ' it added, without elaborating.
The Pentagon said the withdrawal of the invitation was in response to what it sees as Beijing's militarisation of islands in the disputed South China Sea, a strategic waterway claimed in large part by Beijing.
China's military, he said, would be "firm and unwavering in its determination to strengthen sea and air operational preparedness construction" on the islands.
RIMPAC is held every two years and involves more than 20 countries, including Japan, India, and the UK.
American warships will continue to be deployed in the region "on an everyday basis", Pentagon spokesman Lt. Col. Christopher Logan told the Russian media on Sunday.
It also follows the United States' decision to disinvite the Chinese People's Liberation Army-Navy from the 2018 iteration of the Rim of the Pacific exercise.
State-run news agency Xinhua said the two vessels were "expelled" from the waters.
Trump's cancellation of a summit with North Korean leader Kim Jong Un has put further strain on U.S.
Kim, Moon meet to rescue meet Trump announced on Thursday that he was cancelling the planned meeting with Kim , which had been slated for June 12 in Singapore. They agreed to have their top officials meet again June 1 and to set up separate talks between their top generals.