Secretary of State John F. Kerry speaks at the Ho Chi Minh University of Technology and Education in Vietnam on Friday. (Alex Brandon/AFP/Getty Images)

Secretary of State John F. Kerry assured Vietnam’s Communist leaders Friday that ties with the United States will continue to grow under the Trump administration even as the president-elect bashes a major U.S.-Asia trade pact.

Kerry urged Vietnam to continue to embrace the principles underlying globalized trade while acknowledging that Donald Trump’s election victory tapped into voter worries over the loss of manufacturing jobs and economic control in the West.

In meetings with senior government officials, Kerry hewed to a message of partnership in a speech he gave at the Ho Chi Minh City University of Technology and Education.

“I’ve returned to Vietnam now to emphasize the shift in administrations in Washington is not going to alter or fundamentally undermine the commitment of the United States to the stability and the prosperity of the Asia-Pacific,” he said in the speech, which seemed directed as much toward Vietnam’s leaders as to its youths.

“Our friendship doesn’t depend on individuals or personalities, one president or the other, one party or the other,” he added.

Kerry’s visit to Vietnam, the first stop in his final trip as secretary of state, is designed in part to cement President Obama’s “pivot” to Asia and Vietnam’s expanding economic importance.

It is the fastest-growing export market for the United States. Vietnam also was one of 12 countries that signed the Trans-Pacific Partnership trade agreement, which Trump has called a “terrible deal for America” and vowed to scrap.

Kerry acknowledged that he trade deal’s fate is “uncertain.”

[Watch: Trump’s pick to succeed Kerry doesn’t oppose the Asian trade deal ]

“I cannot predict what the new American administration is going to do with respect to trade, but I can tell you that the reasons for the TPP haven’t changed,” Kerry said. He maintained that the United States needs exports to grow the economy and that technology, not trade, kills most manufacturing jobs.

Kerry acknowledged that many Americans find globalization “unsettling” as middle-class manufacturing jobs are lost.

“In my country and in many others in the industrialized world, we know we have to do much more to address the concerns of people who feel the dislocation taking place at a rapid pace,” he said.

But Kerry urged Vietnam to continue economic reforms and keep environmental and labor protections embedded in the TPP agreement.

Even in his official meetings, there is an intensely personal quality to Kerry’s visit.

He fought in Vietnam as a Navy lieutenant in 1968 and 1969. Together with Sen. John McCain (R-Ariz.), he was instrumental in the 1995 normalization of relations between Washington and Hanoi. He has made about two dozen trips here over the years, looking for the remains of missing Americans. This marks his fourth visit to Vietnam as secretary of state.

Kerry evoked the war years as he recalled relaxing on the rooftop of the Rex Hotel in what was then Saigon as night flares and tracers lit up the horizon. But he quickly segued to the future.

“Obviously this is a changed city and it’s a changed country,” he told the university students. “Your foreign minister used to say to me, ‘We have get to the day when we think of Vietnam not as a war but as a country.’ We’re beyond that.”

Kerry was greeted warmly by Vietnamese officials, having worked with many of them — or, in some cases, their fathers — on earlier visits.

“Say hello to your dad,” Kerry told one Vietnamese diplomat, referring to Vietnam’s first United Nations ambassador, who had been Kerry’s interpreter on a trip he made while a senator.

[What you need to know about Trump’s trade views on China]

Prime Minister Nguyen Xuan Phuc called Kerry a “steadfast friend who has made many efforts to heal relations that have undergone many ups and downs” as the two countries transitioned from being enemies to cooperating on security issues.

After their meeting, Phuc walked Kerry to the door of a cavernous conference room dominated by a bust of Ho Chi Minh. With a big smile, he stretched out his arms to the much taller Kerry and the two embraced.

Several times, Kerry marveled at the strides made in U.S. relations with Vietnam, which many Americans associate with a war that divided families and a country. Now, construction is about to begin on Fulbright University Vietnam, the first nonprofit university in the country. And next year, the first Peace Corps volunteers are due to arrive.

“Fifty years ago, hundreds of Americans were fighting in the fields, the forests, the mountains and the waterways of Vietnam,” Kerry said. “Today, hundreds of thousands are visiting your shops, your hotels, your markets, your shrines.”

But several issues remain contentious.

Kerry said they had outlined plans to build 19 power plants fired by coal. He said he had urged the Vietnamese not to use “the dirtiest fuel in the world,” because the long-term costs to the environment and human health outweigh any short-term savings.

Kerry said he also brought up human rights issues. After several years of greater tolerance for dissidents and activists, human rights groups say, Vietnam’s government has cracked down in the past year — including in the weeks before Kerry’s arrival — by detaining activists or placing them under house arrest.

“The right of individuals to speak their mind, to worship, to travel, to acquire and share knowledge and information, and to take part in the decisions that affect their lives, we think that’s an inalienable right,” Kerry said.

Read more:

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news