But Tuesday, the scheduled start of the gathering, came and went without any of the coverage in the state news media that readers in the two countries had expected. The Chinese Defense Ministry later said in a terse statement that it had canceled the event “for reasons related to working arrangements.”

Analysts, citing government sources, said that the Chinese delegation had unexpectedly cut short a trip to Vietnam after tempers flared during a closed-door discussion on disputed territories in the South China Sea.

The cancellation is highly unusual for the two Communist neighbors, and it comes as Beijing continues to build artificial islands in the South China Sea, where the Chinese seek to expand their military influence at a time of uncertainty over President Trump’s policies in the region.

“This was not what the Vietnamese expected from a polite guest,” said Alexander L. Vuving, a Vietnam specialist at the Daniel K. Inouye Asia-Pacific Center for Security Studies in Hawaii.

“You can say both sides miscalculated,” he added. But another interpretation is that both countries are “very committed to showing the other their own resolve” on matters of territorial sovereignty.

The dispute happened during a visit to Hanoi this week by Gen. Fan Changlong of China. It was unclear what precisely roiled his meeting with Vietnamese officials, much less whether the general’s actions had been planned.

Analysts said he appeared to have been angry over Vietnam’s recent efforts to promote strategic cooperation with the United States and Japan. Prime Minister Nguyen Xuan Phuc recently visited those two countries in quick succession, and the Vietnamese and Japanese coast guards conducted joint drills in the South China Sea last week focused on preventing illegal fishing.

Another reason, analysts said, could be Vietnam’s apparent refusal to abandon oil and gas exploration in areas of the South China Sea that both it and Beijing claim.

Mr. Vuving said a specific source of the dispute may have been the so-called Blue Whale project, a gas-drilling venture in the South China Sea by Vietnam’s state oil company, PetroVietnam, and Exxon Mobil. The companies signed an agreement during a January trip to Hanoi by John Kerry, the secretary of the state at the time.

The drilling site, which is expected to produce gas for power generation by 2023, is close to the disputed Paracel Islands and near the “nine dash line” that shows expansive territorial claims on Chinese maps. Mr. Vuving said that China probably resents that Vietnam has formed a partnership with an American oil company, particularly one whose previous chief executive, Rex W. Tillerson, is Mr. Trump’s secretary of state.

The project appears to set a “very damaging precedent for China’s strategy in the South China Sea,” Mr. Vuving said.

The Chinese and Vietnamese Foreign Ministries did not respond to requests for comment on Wednesday, and an Exxon Mobil spokeswoman in Singapore could not be reached for comment.

Other analysts said that the source of tension may have been Vietnam’s recent decision to resume oil exploration in another disputed part of the South China Sea.

Carl Thayer, a longtime analyst of the Vietnamese military and emeritus professor at the University of New South Wales, said that if General Fan had indeed asked Vietnam to cease oil exploration in that area, Vietnam would have considered the request “inflammatory”; it would have implied Chinese territorial control in the Exclusive Economic Zone off the Vietnamese coast.

“Vietnam’s leaders would have refused this request and responded by reasserting Vietnam’s sovereignty,” Mr. Thayer said in an email to reporters and diplomats.

There were unconfirmed reports on Wednesday that China had recently deployed 40 vessels and several military transport aircraft to the area. Vietnam accused Chinese ships of cutting the cables of one of its seismic survey vessels there in 2011.

Though China is Vietnam’s largest trading partner and a longtime ideological ally, the neighbors have long been at odds over competing claims to rocks, islands and offshore oil and gas blocks in the South China Sea, which Vietnam calls the East Sea.

Tensions came to a head in 2014, when a state-run Chinese company towed an oil rig near the Paracel Islands and within about 120 nautical miles of Vietnam. No one was killed at sea, but a maritime standoff led to anti-China riots near foreign-invested factories in central and southern Vietnam, bringing relations between the countries to their lowest point in years.

A few days before General Fan’s Hanoi visit, Mr. Vuving said, China moved the same oil rig to a position in the South China Sea that is near the midway point between the Chinese and Vietnamese coasts, apparently seeking to pressure Vietnam to cease oil and gas exploration in disputed waters. Data from myship.com, a website affiliated with the Chinese Transport Ministry, showed that the rig has been about 70 nautical miles south of China and 120 nautical miles northeast of Vietnam over the past week.

The first fence-mending gathering, called the Vietnam-China Border Defense Friendship Exchange Program, took place in 2014 and was intended to promote bilateral trust. The meeting this week was expected to include a drill on fighting cross-border crime.

Xu Liping, a researcher at the Chinese Academy of Social Sciences in Beijing who specializes in Vietnam and Southeast Asia, said that the countries were expected to disagree over territorial claims in the South China Sea. But they have established frameworks to defuse disagreements through government channels as well as through the two countries’ Communist parties, he added.

In the end, the two countries “will come out and resolve this problem since both want stability,” Mr. Xu said.

Le Hong Hiep, a research fellow at the Iseas Yusof Ishak Institute in Singapore, agreed with that conclusion, but warned that new tensions could emerge in the short term. China appears increasingly eager to stop Vietnam from growing too close to Japan and the United States, he said.

“As Vietnam tries to achieve its economic growth targets, it is planning to exploit more oil from the South China Sea,” Mr. Hiep wrote in an email. “As such, the chance for confrontation at sea may also increase.”

By Mike Ives - The New York Times - June 21, 2017