Updated

U.S. Gen. Martin Dempsey on Thursday became the first chairman of the Joint Chiefs of Staff to visit Vietnam since 1971, seeking to boost military ties between the former foes at a time when Hanoi is embroiled in territorial disputes with China.

The trip comes amid anger in Vietnam over China's recent decision to deploy an oil rig in a disputed section of the South China Sea.

The United States shares Hanoi's concerns over Beijing's assertiveness, and has indicated it may partially lift a ban on weapons sales to its former enemy, possible as early as next month.

Speaking to his Vietnamese counterpart Lt. Gen. Do Ba Ty before the closed-door talks, Dempsey described his four-day visit as "one of the highlights" of his military career.

The two sides will work to boost military cooperation, with a focus on maritime security, training, and overcoming the legacy of the war, a Vietnamese Ministry of Defense statement said. Ty also told Dempsey that their defense cooperation has recently become more practical, according to the People's Army newspaper.

Vietnamese Foreign Ministry spokesman Le Hai Binh said the visits by Dempsey and U.S. Defense Secretary Chuck Hagel later this year were "concrete steps to promote and implement the comprehensive partnership" established in July last year during Vietnamese President Truong Tan Sang's trip to the United States.

Bilateral trade and investments have grown quickly since the normalization of relations in 1995, making the U.S. one of Vietnam's top trading partners and investors, but military cooperation has been limited because of a U.S. ban on lethal arms sales that has been in place since the Vietnam War ended in 1975.

China's withdrawal of the rig in mid-July removed an irritant but left strained relations and questions among China's other neighbors about its long-term strategy in laying claim to most of the South China Sea.

Russia has been Vietnam's main source of armaments, and Hanoi has earmarked hundreds of millions of dollars to build more vessels to improve its maritime capability.

During his stay, Dempsey will have talks with Prime Minister Nguyen Tan Dung and Defense Minister Phung Quang Thanh. He is expected to visit a former U.S. air base in Danang in central Vietnam, where the U.S. two years ago began a landmark project to clean up Agent Orange from the site.

Part of the former base consists of a dry field where U.S. troops once stored and mixed the defoliant before it was loaded onto planes to be sprayed to deny forest cover for the Communist fighters during the war.

The last chairman of the Joint Chiefs to visit U.S.-backed South Vietnam was Adm. Thomas Moorer in 1971.