HANOI, Vietnam — Goose-stepping soldiers and children with red Communist kerchiefs greeted Kim Jong-un on Friday afternoon in Vietnam, as the North Korean leader shifted from the unpredictability of his summit meeting in Hanoi with President Trump, which ended unexpectedly with no accord, to a carefully staged state visit.
A day after the meeting ended abruptly and ahead of schedule, President Nguyen Phu Trong of Vietnam welcomed Mr. Kim to a more familiar atmosphere, with solemn expressions of Communist comradeship, martial music and soldiers parading with rifles as the two leaders watched from a reviewing platform.
The meeting with Mr. Trump was supposed to make progress toward eliminating North Korea’s nuclear weapons program and formally ending the Korean War. But there was another, implicit agenda, as well: Both allies and adversaries of Mr. Kim’s impoverished and oppressed nation had hoped that he might be inspired by the way Vietnam has flowered economically while keeping a grip on politics.
It was not clear how much of that message he might absorb. After meeting with the impulsive Mr. Trump and facing an unruly throng of journalists, Mr. Kim turned to a schedule with all the scripted, red carpet formality of an official visit to a fellow Communist state.
Mr. Kim’s trip to Vietnam, the fourth country he has visited since taking power in 2011, contrasts sharply with his time in Singapore last June, when he and Mr. Trump held their first direct talks and Mr. Kim also played the tourist.
Taking a stroll through a futuristic flower garden and stopping by a rooftop bar, Mr. Kim appeared to relish Singapore’s modernity. He grinned for a selfie by Vivian Balakrishnan, Singapore’s foreign minister, which was quickly posted online.
This time, no selfies are expected. There has been no tourism. There will be no more news conferences.
After his meeting with Mr. Trong on Friday, Mr. Kim met with Prime Minister Nguyen Xuan Phuc before attending a state banquet in his own honor.
On Saturday morning, Mr. Kim is scheduled to lay wreaths at a war memorial and the mausoleum of Ho Chi Minh, the revolutionary hero. Then he will head in his armored stretch Mercedes-Benz to the border with China, where he will board his luxury train for the return journey to North Korea.
Vietnam is far less repressive than North Korea, but its economic liberalization has not been matched by a comparable expansion of political and civil rights.
On the eve of Mr. Kim and Mr. Trump’s arrival in Hanoi, the capital, Vietnamese dissidents complained that they were being prevented from leaving their homes or had been warned by security officials to reject interview requests from foreign news media. Nearly 100 prisoners of conscience were in Vietnamese jails last year, according to human-rights groups.
Calling Vietnam’s human rights record “deplorable,” the joint chairs of the Congressional Caucus on Vietnam wrote a letter to Mr. Trump last month, urging him to raise with Vietnam’s leaders the country’s restrictive new cybersecurity law and the detention of Americans.
There was no indication that Mr. Trump had raised human rights with the Vietnamese leadership when they met on Wednesday — or with Mr. Kim. Instead, he complimented his hosts on the nation’s economic transformation.
“I drove down the boulevards, and I saw all of the buildings under construction and how Vietnam is thriving,” Mr. Trump told Mr. Trong on Wednesday. “You really are an example as to what can happen with good thinking.”
On Thursday morning, before negotiations on sanctions broke down and the American delegation left Vietnam earlier than scheduled, Mr. Trump also talked up North Korea’s economic potential.
“They’re going to have an economic powerhouse,” Mr. Trump said of North Korea, which has a growing black-market economy. “I believe that it will be something, economically, that will be almost hard to compete with for many countries; it has such potential,” he added.
As Mr. Kim arrived in Hanoi on Tuesday, Vietnamese officials stressed how Vietnam could serve as a model for North Korea. Mr. Kim would most likely visit a high-tech park or the factory for the country’s first domestic automaker to get a firsthand look at how market reforms have allowed Vietnam to flourish, Vietnamese state news media said.
“Globalization does not exclude any country,” said Nguyen Manh Ha, the former director of the Vietnam Communist Party History Institute at the Ho Chi Minh National Academy of Politics. “We recognize that socialism has some shortcomings when it comes to the economy.”
But Mr. Kim did not tour any of these centers of economic activity. Only some of his underlings did.
North Korea was one of the first countries to recognize Vietnam’s independence from France, and Mr. Kim’s grandfather Kim Il-sung, the founder of the political dynasty that has ruled North Korea since the nation’s founding, visited Vietnam twice.
In 1964, Mr. Kim’s grandfather toured Halong Bay, a collection of picturesque islands that is now a popular foreign tourist destination. Despite hopes that Mr. Kim would also visit there, local officials had to make do with a stopover on Wednesday by a North Korean delegation missing its supreme leader.
Mr. Kim has cultivated a resemblance to his stocky grandfather, his hair cut high above the ears and combed straight back, his belly straining against his Asian-style suit.
But on Friday, in his first public appearance since a signing ceremony with Mr. Trump was canceled because there was no agreement to sign, Mr. Kim’s demeanor was far more serious than his grandfather’s was in Vietnam. In archival photos, Kim Il-sung is often laughing with Mr. Ho, two men embarking on socialist experiments.
Just before midnight on Thursday, the North Koreans called a news conference at the Melia Hotel in Hanoi, where Mr. Kim was staying, to present their version of how the talks with Mr. Trump had broken down. It was an unusual break from protocol for a leadership that rarely allows unscripted moments.
And in another last-minute change, Mr. Kim’s scheduled departure from Vietnam on Saturday has been moved up by half a day, according to diplomatic sources. He may make a beeline for Beijing, North Korea’s only patron, to discuss the fallout of the failed talks with Mr. Trump, they said.
Though the Chinese leadership has expressed frustration with Mr. Kim, their red carpet, it is safe to assume, will still be rolled out.