Launched on Jan. 30, 1968 by North Vietnam and its Viet Cong allies, the Tet Offensive completed the illusion of a U.S. victory in Southeast Asia. Fifty years later, the specter of war has certainly not disappeared completely. Last week’s Vietnam visit by Defense Secretary James Mattis was not for commemorative purposes. His primary goal was to stress the importance of the strategic relationship between Hanoi and Washington in a region where China’s assertiveness has raised worry and tension.

The Tet Offensive concluded in late February 1968 with the retaking of the city of Huế by the Americans and their South Vietnamese allies. If, from a strictly military point of view they could claim victory, politically speaking, it was North Vietnam and their Viet Cong allies who won the battle despite suffering 40,000 casualties. After weeks of violent combat, the bond of trust between the American population and its political and military leaders was broken, the United States’ will to fight was defeated, and the prospects for success had evaporated.

A half-century after the decisive turning point in the most traumatic conflict in contemporary American history, Mattis could not escape these painful memories during his 2-day visit. He met with members of the Defense Department agency responsible for finding and identifying the remains of some 1,300 still-missing soldiers. He also noted that propaganda saluting the victory against the Americans is still present in the streets of Hanoi.

Although the traces of a troubled past have not disappeared, Vietnam and the United States have an increasingly close and strategically important relationship. In fact, in the last five years, no other Southeast Asian country aside from Vietnam has so determinedly opposed Chinese ambitions in the region. In this context, Hanoi and Washington established a strengthened partnership under the Obama administration that resulted in the lifting of the ban on U.S. weapons sales in Vietnam and increased military cooperation.

In the national defense strategy presented about 10 days ago by the Trump administration, Vietnam even constitutes a pillar of the security architecture that the U.S. wants to put in place in Asia. Yet, since Donald Trump’s arrival in the White House, Vietnamese leaders seem less certain about betting on their relationship with Washington at the expense of Vietnam’s traditional approach of maintaining a balance between the United States and China.

Over the course of recent months, Vietnam has acted less virulently toward China. For example, after granting exploration rights to the Spanish oil company Repsol in the South China Sea, Vietnam suspended drilling permits following pressure from Beijing. At the end of November, Vietnamese and Chinese leaders issued a cordial joint statement in which they pledged to do everything possible to preserve the peace in these highly disputed waters.

Several factors explain Hanoi’s more conciliatory attitude toward China. China is a major economic partner that should not be offended. The Philippines were an important ally in defending the interests of countries surrounding the South China Sea against Beijing’s claims. They are now led by Rodrigo Duterte, a president who is positioning himself resolutely in the Chinese camp. Domestic policy issues, such as the fight against corruption, have also shifted the attention of Vietnamese leaders away from foreign policy matters.

President Trump’s mistrust of free-trade agreements and his decision to withdraw the United States from the Trans-Pacific Partnership (which would have significantly benefitted the Vietnamese economy) are nevertheless instrumental in explaining Hanoi’s suddenly more cautious behavior. Mattis would do well to use the Vietnamese, Indonesian and Filipino names to describe the disputed areas in the South China Sea. It is easy to recall Washington’s determination to conduct regular free movement operations there. Until Trump understands the strategic importance of trade agreements to establish the credibility of U.S. engagement, he will weaken the U.S. position in the Asia-Pacific region.