ABOARD A U.S. MILITARY AIRCRAFT — Lifting the U.S. arms embargo for Vietnam will lead to warmer ties between the two countries’ militaries, including maritime cooperation in the contested South China Sea, U.S. Defense Secretary Ash Carter said Monday. But Carter and President Barack Obama, who is visiting Vietnam, insisted the move was not directed at China, which is locked in a dispute with Hanoi and other neighbors over ownership of islands throughout the sea.

“The decision to lift the ban was not based on China or any other considerations,” Obama said at a press conference in Hanoi on Monday. “It was based on our desire to complete what has been a lengthy process of moving towards normalization with Vietnam.”

While Carter echoed Obama, saying the move to sell arms to Vietnam was not aimed at Beijing, he said “there’s no question that China’s actions there, particularly those over the past year, have heightened concern in the region, and that’s another factor that causes everyone to want to work with us.”

“In terms of its wider regional meaning, what it is is a reflection of the fact that more and more countries in the region are coming to the United States to do more and more with us because of their general concern with the security environment,” Carter told reporters en route to New Haven, Conn., where he will watch the commissioning of Yale’s first graduating ROTC class since the 1970s.

Deepening U.S.-Vietnamese military cooperation is part of a larger trend under Obama of improving bilateral relations with Pacific Rim countries, Carter said.

Washington has increasingly been leaning on Hanoi to counter Beijing’s military buildup.Earlier this morning, Obama announced that the U.S. will end a decades-long embargo on the sales of lethal arms to Vietnam.

“We're going to continue to engage in the case-by-case evaluations of these sales,” Obama said. “But what we do not have is a ban that's based on an ideological division between our two countries, because we think, at this stage, both sides have established a level of trust and cooperation, including between our militaries, that is reflective of common interests and mutual respect.”