HANOI, Vietnam — President Barack Obama’s mission in Vietnam and Japan is to build stronger economic and security ties with Asian-Pacific allies anxious about the rise of an increasingly muscular China. That forward-looking message will be delivered even as he confronts the legacies of two wars long past — Vietnam and World War II — that still are fraught with emotion.

Obama’s first stop on his weeklong Asia trip was Vietnam, where he is the third sitting president to visit since the end of the war. Four decades after the fall of Saigon, and two decades after President Bill Clinton restored relations with the nation, Obama is eager to upgrade relations with an emerging power whose rapidly expanding middle class beckons as a promising market for U.S. goods and an offset to China’s growing strength in the region.

Obama arrived in Hanoi late Sunday. During his three-day stay in Vietnam, he’ll make the case for stronger commercial and security ties, including approval of the 12-nation trans-Pacific trade agreement that is stalled in Congress and facing strong opposition from the 2016 presidential candidates. Vietnam also is hoping that Obama will use the visit to erase an irksome vestige of the war by lifting the U.S. partial embargo on selling arms to the country. The idea is under consideration, but concern about Vietnam’s human rights record could weigh against it.