In a diplomatic victory for President Trump, North Korea freed three American prisoners on Wednesday, removing a bitterly emotional obstacle ahead of a planned meeting between him and the young leader of the nuclear-armed nation.
The release of the three prisoners, all citizens of Korean descent, was in some ways the most tangible gesture of sincerity shown by North Korea’s leader, Kim Jong-un, to improve relations with the United States after nearly seven decades of mutual antagonism.
Mr. Trump said the three were freed following an unannounced visit to North Korea by Secretary of State Mike Pompeo, who was in Pyongyang, the North’s capital, for more discussions with North Korean officials about the expected meeting between Mr. Kim and Mr. Trump.
The prisoner release extended the turnabout from last year when the two leaders threatened each other with nuclear war. Mr. Kim recently announced that North Korea would stop all nuclear and long-range missile tests and shut down its nuclear test site as gestures of good will.
But unlike those announcements, the release of the three Americans is permanent, and Mr. Kim forfeited a bargaining chip in freeing them. No other Americans are believed to be held prisoner in North Korea.
The United States has persistently demanded the release of the three citizens — Kim Dong-chul, Tony Kim and Kim Hak-song — who were held on charges of committing espionage or unidentified “hostile acts” against North Korea.
Their release was said to be tied to Mr. Trump’s agreement to meet with Mr. Kim in the first face-to-face encounter between the top leaders of the two nations, during which Mr. Trump, 71, hopes to persuade Mr. Kim, 34, to abandon his nuclear weapons and the missiles that can carry them.
Anticipation of the release had been building since Mr. Pompeo secretly visited North Korea over the Easter weekend. He was still the C.I.A. director then, and held initial talks with Mr. Kim and other top North Korean officials about the planned summit meeting, which could happen in the next few months.
Mr. Trump teased the possibility they would be freed last week in a Twitter post, in which he also incorrectly asserted that President Barack Obama’s administration had unsuccessfully pressed for their release. Two of the three were seized after Mr. Trump took office.
American detainees in North Korea have been an especially delicate issue between the two countries. One of them, Otto F. Warmbier, an undergraduate at the University of Virginia, was sentenced to 15 years of hard labor in 2016 for trying to take a propaganda poster while on a trip to North Korea. He died last June shortly after being released in a coma, having spent 17 months in captivity.
His parents, Fred and Cindy Warmbier, recently filed a lawsuit in the United States accusing North Korea of kidnapping and fatally torturing their son, and last week they appeared at the United Nations to speak out about human rights abuses in North Korea.
“They used him as a political pawn for as long as they could,” Mr. Warmbier said of his son, “and when he was of no value to them, they essentially sent him home to our family in a body bag.”
The three Americans who were released had all been taken over the past two years.
Kim Dong-chul, a businessman, had been sentenced to 10 years of hard labor in April 2016 after being convicted of spying and other offenses.
A month before his trial, Mr. Kim appeared at a government-arranged news conference in Pyongyang and apologized for what he described as his attempted theft of military secrets in collusion with South Koreans. The South Korean spy agency has denied any involvement.
Mr. Kim’s predicament was not known until January 2016, when the North Korean government let CNN interview him in Pyongyang. At that time, Mr. Kim identified himself as a 62-year-old naturalized American citizen who lived in Fairfax, Va. He said he had once run a trading and hotel services company in Rason, a special economic zone near North Korea’s borders with China and Russia.
He said he had been arrested in October 2015 while meeting with a former North Korean soldier to receive classified data.
Tony Kim, also known as Kim Sang-duk, was arrested in April 2017. He had spent a month teaching accounting at Pyongyang University of Science and Technology, a Christian-funded college, and was trying to board a plane to leave the country when he was arrested, according to university officials.
Mr. Kim, who is in his 50s, studied accounting at the University of California, Riverside, and at Aurora University, and he worked as an accountant in the United States for more than a decade, according to his Facebook page.
Kim Hak-song was arrested on May 6, 2017. He volunteered at Pyongyang University of Science and Technology, doing agricultural development work at its research farm.
According to CNN, Mr. Kim, an ethnic Korean, was born in Jilin, China, near the North Korean border, and emigrated to the United States in the 1990s. After becoming an American citizen, the network said, Mr. Kim returned to China and studied agriculture in Yanbian before moving to Pyongyang.
While North Korea’s gesture on the three prisoners was welcomed in the United States, North Korea experts also cautioned that it should not necessarily be seen as a significant concession.
“It’s also worth remembering that North Korea’s practice of seizing, imprisoning and, in one case, probably torturing Americans represents reprehensible behavior that says something about the nature of the regime,” said Evans J.R. Revere, a former State Department diplomat who specializes in East Asia. “I would not give Pyongyang too much credit for undoing something it shouldn’t have been doing in the first place.”