BEIJING — China’s military announced on Sunday that it had dispatched warships to challenge two United States Navy vessels that sailed through waters in the South China Sea that China claims as its own.

The Chinese confronted the American ships and warned them to leave, the Ministry of National Defense said in a statement posted on its website, but other details of the encounter were not immediately clear.

The American vessels — the Higgins, a destroyer, and the Antietam, a cruiser — passed within 12 nautical miles of the Paracel Islands, an archipelago in the northern part of the disputed waters of the South China Sea off the coast of Vietnam.

The chief spokesman for China’s Ministry of National Defense, Senior Col. Wu Qian, said that the United States “gravely violated Chinese sovereignty.”