China urged the United States to respect its sovereignty on Thursday, with the foreign ministry of the people's republic saying a U.S. navy destroyer that carried out a "freedom of navigation operation" earlier on the same day in the South China Sea had violated international and Chinese law and seriously harmed Beijing's sovereignty and security.

U.S. officials earlier told Reuters the USS John S. McCain had travelled close to Mischief Reef in the Spratly Islands, among a string of islets, reefs and shoals, an area where China has territorial disputes with its neighbours.

"The U.S. destroyer's actions have violated Chinese and international laws, as well as severely harming China's sovereignty and security," the ministry said late on Thursday in a statement on its website.

This US Navy file photo taken on March 21, 2013 shows the Arleigh Burke-class guided-missile destroyer USS John S. McCain (DDG 56) sailing in the waters off the Korean Peninsula. (AFP file photo)