WASHINGTON (Reuters) - When the United States imposed sanctions on China’s military this fall, China retaliated by canceling Defense Secretary Jim Mattis’ plans to meet his counterpart in Beijing. But just days later, a Chinese general visited the Pentagon with a reassuring message: Beijing valued the importance of military ties between the two countries.

FILE PHOTO: Secretary of Defense Jim Mattis speaks with the media before an enhanced honor cordon arrival of Greek Minister of Defense Panagiotis Kammenos at the Pentagon in Washington, U.S., October 9, 2018. REUTERS/Joshua Roberts/File Photo

In the previously unreported visit, Huang Xueping arrived on Oct. 10 to see Mattis’ aides, but the secretary briefly met him in the hallway with a message for Chinese Defense Minister Wei Fenghe. The two were still going to be at a security conference in Singapore later in October, and Mattis told Huang he looked forward to meeting Wei there, said Randall Schriver, the Pentagon’s top Asia policy official.

Relations between the world’s two largest economies have plumbed new depths under President Donald Trump amid a bitter trade war and disagreements over Taiwan, the South China Sea, and other geopolitical flashpoints.

Worried that weak ties between major militaries can lead to misunderstandings that snowball into conflict amid tense relations, U.S. officials said Mattis is attempting to forge a relationship with Chinese military leaders.

He appears to be getting traction. On Friday, he is set to hold a third meeting with Wei in less than five months, an unusual intensity of top-level contact. Mattis’ trip to China in June was the first by a U.S. defense secretary since 2014.

Schriver said U.S.-China talks in Washington on Friday will include “risk reduction” efforts that the two countries can undertake, which aim to drive down the chance of an inadvertent clash.

“We want to make sure that as we compete that it’s a benign type of competition (and) doesn’t result in something catastrophic,” he said.

RISK OF MISHAP

New military data and recent incidents involving U.S. military activity in the South China Sea and the Taiwan Strait show the defense secretary is walking a fine line. Even as Mattis tries to forge ties to contain crises, the Pentagon is ramping up activity that irritates the Chinese government.

In the 12 months ending on Sept. 30, for example, there were six so-called “Freedom of Navigation” operations in the South China Sea, compared with four in the same period of the previous year, a U.S. official told Reuters.

Such operations involve sending warships into international waters if they are claimed by other countries. China claims most of the South China Sea and has been militarizing islands there.

(Tracking expansion in the South China Sea. See graphic tmsnrt.rs/2J3cWne)

The six operations are equivalent to what the Navy did during the last two years of President Barack Obama’s administration.

The Pentagon is also running warships through the Taiwan Strait with greater frequency and this year weighed sending an aircraft carrier through the narrow waterway, U.S. officials said. China claims Taiwan as its own and sees U.S overtures to self-ruled Taiwan as meddling in its internal affairs.

Susan Thornton, who until July was the State Department’s top Asia adviser, said the increased military activity is ratcheting up the risks.

“We are doing things that are frankly more aggressive, and the Chinese are pushing back harder than they ever have before,” Thornton said. “The risk of a mishap is growing.”

Schriver acknowledged that it was hard to predict how resilient U.S.-Chinese military ties would be in an actual crisis. “I guess we won’t know until there’s a crisis, and it’s tested,” he said.

“WISE MAN”

China is becoming more assertive militarily. On Sept. 30, for example, a Chinese ship came within 45 yards of a U.S. Navy destroyer in international waters in the South China Sea. The Chinese ship put bumpers on its side, suggesting it expected a possible collision when it ran the maneuver.

“You don’t do that when you’re out in the middle of the ocean, unless you’re intending to run into something,” Mattis told reporters last month.

At the same time, China’s defense ministry has said it hopes the military relationship can become a “stabilizer” for overall ties, and officials have suggested that Beijing has more confidence in Mattis than some other top Trump administration officials.

One Chinese official said Beijing regards Mattis as a “wise man,” experienced enough in war to know that it is best to avoid armed conflict.

The Chinese defense ministry did not respond to a request for comment.

COMPETITOR, NOT ENEMY

Thornton said Mattis’ China contacts, while helpful, would not be enough to bridge gaps elsewhere in the Trump administration in the event of a crisis. Further, if Mattis were to leave, his successor would need time to come up to speed, a dangerous prospect at a time of heightened tensions, she said.

Mattis’ departure from the cabinet has been the subject of media speculation, although both Mattis and Trump have dismissed the idea.

When Mattis flew to Beijing in June, he got an earful from China’s military about the Pentagon’s decision to describe China as a “strategic competitor” militarizing the South China Sea in a key Pentagon policy document.

In his closed-door talks, Mattis defended the description, saying the Pentagon chose those words carefully, knowing they would be scrutinized in Beijing, said the U.S. officials who heard the exchange.

“Competitor is not adversary. It’s not enemy,” Schriver said, explaining Mattis’ position.

The two sides have met on other occasions as well for confidence-building measures. The top U.S. general, Joe Dunford, said this week that the U.S. and China held a “table-top” exercise about four months ago, where the two sides discussed various potential crisis scenarios.

The goal of the exercise, Dunford said, was to reduce the risk of miscalculation during a crisis.

Speaking at a Washington event last week, Mattis said, “I think that 15 years from now we will be remembered most for: How did we set the conditions for a positive relationship with China?”