WASHINGTON (Reuters) - Standing side by side, top U.S. officials urged their Chinese counterparts on Friday to halt militarization of the disputed South China Sea, drawing a rebuke from the Chinese for sending U.S. warships close to islands claimed by Beijing.

During a round of high-level talks in Washington, the two sides aired in sometimes blunt terms many of their main differences, including a bitter trade dispute, freedom of navigation in Asia-Pacific waters, self-ruled Taiwan, and China’s crackdown on its Muslim minority in Xinjiang.

Two visiting senior Chinese officials also seized the opportunity to warn publicly that a trade war between the world’s two largest economies would end up hurting both sides and to call for keeping channels of communication open to resolve an issue that has unsettled global financial markets.

Despite the airing of grievances, the talks appeared aimed at controlling the damage to relations that has worsened in recent months and at paving the way for an encounter between U.S. President Donald Trump and Chinese President Xi Jinping at the Group of 20 summit in Argentina at the end of November.

“The United States is not pursuing a Cold War or containment policy with respect to China,” U.S. Secretary of State Mike Pompeo told a joint news conference.

Even as the United States and China confront difficult challenges, “cooperation remains essential on many issues,” he said, citing efforts to persuade North Korea to abandon its nuclear program.

The meeting paired Pompeo and Defense Secretary Jim Mattis with Chinese Politburo member Yang Jiechi and Defense Minister Wei Fenghe. The annual U.S.-China Diplomatic and Security Dialogue was originally set for Beijing last month but had been called off amid rising tensions.

U.S. Secretary of State Mike Pompeo and Defense Secretary James Mattis listen to Chinese Communist Party Office of Foreign Affairs Director Yang Jiechi speak as they hold a joint media news conference after participating in a second diplomatic and security meeting at the U.S. Department of State, Washington, U.S., November 9, 2018. REUTERS/Leah Millis

Pompeo took aim at China over its continued building of military installations on artificial islands and reefs in the South China Sea, where China insists it has sovereignty despite competing claims from some smaller neighbors.

“We have continued concerns about China’s activities and militarization in the South China Sea,” Pompeo said following the talks. “We pressed China to live up to its past commitments in this area.”

Yang said China was committed to “non-confrontation” but that Beijing had the right to build “necessary defense facilities” on what it considers its own territory and urged Washington to stop sending warships and military planes close to the islands that Beijing claims.

Mattis made clear that this demand go unheeded by Washington, which insists it is acting under international law to preserve access for it and others to the South China Sea.

In a statement on Saturday, China’s Foreign Ministry described the talks as “frank, constructive and very fruitful.”

TAIWAN

Responding sharply to Pompeo’s mention of Taiwan, which China considers a wayward province but which is armed by Washington, Wei said Beijing would defend its claim on the island “at any cost.”

But Wei and Mattis agreed on the need to lower U.S.-China military tensions to avoid unintended clashes, with the Chinese general saying confrontation “will spell disaster to all.” Washington has protested to Beijing about recent behavior by its warships that the U.S. Navy considered unsafe.

While Pompeo spoke little about trade in his public comments, Yang said he hoped the two sides would find a mutually acceptable solution on the issue “before long.”

China and the United States have slapped tariffs on hundreds of billions of dollars of each other’s goods, jolting global financial markets, and Trump has threatened to set tariffs on the remainder of China’s $500 billion-plus exports to the United States if the trade dispute cannot be resolved.

Trump’s administration has also accused China of meddling in U.S. politics ahead of this week’s congressional elections, charges China strongly denies.

Reflecting growing U.S. concerns about the Chinese cyber threat, a senior U.S. intelligence official on Thursday accused China of violating a 2015 agreement aimed at stopping cyber espionage through the hacking of government and corporate data.

Pompeo also reiterated U.S. criticism of China’s “repression of religious groups,” citing treatment of Buddhists in Tibet and minority Uighur Muslims in the Xinjiang region that has drawn condemnation from human rights groups.

Yang defended China’s policies in Xinjiang as measures against “ethnic separatist activities and violent terrorist crimes” but said it was a Chinese internal affair and foreign governments should not interfere.