In 2012, the United States secretary of defense, Leon E. Panetta, visited Cam Ranh Bay, the site of a major American base during the Vietnam War, but so far the Vietnamese military, still mindful of that war and years of antagonistic relations after it ended in 1975, has kept its distance.

Part of the aloofness is the result of a United States executive order that prohibits the sale of American weapons to Vietnam, a vestige of the Vietnam War. But Washington is showing increasing interest in lifting the ban, and the expected new United States ambassador to Vietnam, Ted Osius, who is awaiting confirmation from the Senate, said in testimony last month that easing the embargo should be considered.

For the moment, Vietnam buys weapons mainly from Russia, Israel and India. It has taken delivery of two Kilo-class submarines from Russia, and has ordered four more. Japan has pledged to provide coast guard vessels. In a move intended to encourage Vietnam to accept more from Washington, Secretary of State John Kerry announced $18 million in nonlethal aid for Vietnam’s maritime security during a visit in December.

Vietnam does not expect, or want, intervention by the United States, said Dang Dinh Quy, president of the Diplomatic Academy of Vietnam. “We don’t expect help from anyone,” he said. “We are confident we can do it ourselves. We will keep to current strategies of trying to prevent a clash, and if it happens we will try to deal with it. We welcome all users of the South China Sea as long as they are conducive to preserving peace, stability and a legal order in the region.”

The shadow of the 1979 war, ordered by the Chinese leader Deng Xiaoping to punish Vietnam for its invasion of Cambodia, endures in places along the border. The memories are strong not only because of the death toll but also because the Chinese pummeled towns and villages as they withdrew, destroying schools and hospitals, in what the Chinese military later called a “goodbye kiss.”

Lang Son has since been rebuilt, and modest high-rises emblazoned with neon give it the feel of a prosperous trading post. But people here still remember a river full of bodies, both Vietnamese and Chinese, and how long it took for the terrible smell to go away. The combined death toll has been estimated at least 50,000 troops, along with 10,000 Vietnamese civilians.