BEIJING/WASHINGTON (Reuters) - The U.S. and Chinese navies held high-level talks on Thursday after a U.S. warship challenged China’s territorial assertions in the South China Sea, and a U.S. official said they agreed to maintain dialogue and follow protocols to avoid clashes.

Fiery Cross reef, located in the disputed Spratly Islands in the South China Sea, is shown in this handout Center for Strategic and International Studies (CSIS) Asia Maritime Transparency Initiative satellite image taken September 3, 2015 and released to Reuters October 27, 2015. REUTERS/CSIS Asia Maritime Transparency Initiative/DigitalGlobe/Handout via Reuters

After the talks between U.S. chief of naval operations Admiral John Richardson and his Chinese counterpart, Admiral Wu Shengli, scheduled port visits by U.S. and Chinese ships and planned visits to China by senior U.S. Navy officers remained on track, the official said.

“None of that is in jeopardy. Nothing has been canceled,” said the official.

Both officers also agreed on the need to stick to protocols established under the Code for Unplanned Encounters at Sea.

“They agreed that it’s very important that both sides continue to use the protocols under the CUES agreement when they’re operating close to keep the chances for misunderstanding and any kind of provocation from occurring,” said the official.

The talks, by video conference, were held to calm tensions after Beijing rebuked Washington for sending a guided-missile destroyer within 12 nautical miles of one of China’s man-made islands in the South China Sea’s Spratly archipelago on Tuesday.

A U.S. Navy spokesman stressed Washington’s position that U.S. freedom of navigation operations were meant to “protect the rights, freedoms, and lawful uses of the sea and airspace guaranteed to all nations under international law.”

There was no immediate comment from China on the talks. A spokesman for China’s Ministry of Defense said earlier that Wu would present Beijing’s “solemn position on the U.S. vessel’s entry without permission” into waters in the South China Sea.

“We would urge the U.S. side not to continue down the wrong path,” Defence Ministry spokesman Yang Yujun said. “But if they do, we will take all necessary measures in accordance with the need.”

China suffered a setback on Thursday in its broad territorial claims in the South China Sea when an arbitration court in The Hague said it had jurisdiction to hear some territorial claims the Philippines filed against China.

The court said additional hearings would be held to decide the merits of the Philippines’ arguments. China has not participated in the proceedings and does not recognize the court’s authority in the case.

A senior U.S. defense official welcomed the court’s decision, saying it demonstrated “the relevance of international law to the territorial conflicts in the South China Sea.”

State Department spokesman John Kirby said that in accordance with the terms of the U.N. Convention on the Law of the Sea (UNCLOS), the decision of the tribunal would be legally binding on both the Philippines and China.

MOST SIGNIFICANT U.S. CHALLENGE

The U.S. patrol on Tuesday was the most significant U.S. challenge yet to territorial limits China claims around its artificial islands in one of the world’s busiest sea lanes.

But plans by U.S. Pacific Command commander Admiral Harry Harris and Admiral Scott Swift, commander of the U.S. Pacific Fleet, to visit China remain on track, as do reciprocal port visits by U.S. and Chinese ships in November and December, the U.S. official said.

The U.S. Pacific Command (PACOM) said Harris, who has been highly critical of China’s island building, would arrive in Beijing on Monday, while a U.S. official said Swift would go later in the year.

Harris will spend three days in China to meet military leaders and visit military installations.

“Sustained military-to-military dialogue between the U.S. and China is designed to maximize cooperation on areas of mutual interest while candidly addressing and managing disagreements,” PACOM said.

Next week, Chinese President Xi Jinping will visit Vietnam, another vocal claimant in the South China Sea, and Singapore, while Chinese Defence Minister Chang Wanquan will attend a meeting of Southeast Asian defense ministers in Malaysia that U.S. Defense Secretary Ash Carter is also due to attend.

Analysts said that even though both sides were still talking, it was difficult to see either backing down.

“Neither the U.S. nor China desires a military conflict, but the key problem is that the core interests of both sides collide in the South China Sea,” said Ni Lexiong, a naval expert at the Shanghai University of Political Science and Law.

Chinese state media said on Thursday a “guided-missile destroyer flotilla” under the navy’s South China Sea Fleet carried out a “realistic confrontation training exercise” involving anti-aircraft firing and firing at shore at night.

A state-owned news website carried photos from the drills, saying they took place recently in the South China Sea. One picture showed three warships sailing in a row.

Despite criticism of China’s action in the South China Sea, foreign navies from the United States to Europe have continued to try to build ties with their Chinese counterparts.

A French frigate docked at China’s main South China Sea base of Zhanjiang in the southern province of Guangdong on Wednesday on a four-day visit. It will participate in a maritime exercise about accidental encounters at sea.

Two Australian warships will also hold exercises with the Chinese navy in the South China Sea next week, Australian Defence Minister Marise Payne said on Thursday.

Australia, a key U.S. ally in the region, expressed its strong support for freedom of navigation this week, while stopping short of welcoming the USS Lassen’s patrol.