President Donald Trump tweeted that he “will be there to greet” the three Americans freed from North Korea when they land at Andrews Air Force Base outside Washington early Thursday morning.

The freed Americans told the State Department upon touching down in Alaska on Wednesday: “We would like to express our deep appreciation to the United States government, President Trump, Secretary Pompeo, and the people of the United States for bringing us home. We thank God, and all our families and friends who prayed for us and for our return. God Bless America, the greatest nation in the world.”

Secretary of State Mike Pompeo left North Korea early Wednesday morning with the three American detainees, whom the Trump administration had described as “hostages.” The release capped a dramatic day of diplomacy in Pyongyang. After Pompeo’s 90-minute meeting with Kim Jong Un, he gave reporters a fingers-crossed sign when asked about the prisoners as he returned to his hotel. It was only after a North Korean emissary arrived a bit later to inform him that the release was confirmed.

Pompeo, who first traveled to North Korea as CIA chief in early April, was only the second sitting secretary of state to visit the rogue nation. The first was Madeleine Albright, who went in 2000 as part of an unsuccessful bid to arrange a meeting between then-President Bill Clinton and Kim Jong Un’s father, Kim Jong Il.

The three American detainees were released ahead of an upcoming meeting between Trump and North Korean dictator Kim Jong Un set to focus on North Korea’s nuclear weapons.

The summit is expected to take place in Singapore in early June, Fox News has learned.

The Trump administration had been critical of North Korea’s refusal to grant consular access to the three men, other than a brief visit by a U.S. envoy last June.

Trump made a point of publicly thanking North Korea’s leader for the prisoners’ release — “I appreciate Kim Jong Un doing this” — and hailed it as a sign of cooling tensions and growing opportunity on the Korean peninsula. Kim decided to grant amnesty to the three Americans at Trump’s “official suggestion,” according to North Korea’s official media agency, KCNA.

Kim appreciated that Trump “has shown deep interest in settling the issue through dialogue,” KCNA added.

A Trump-Kim meeting seemed a remote possibility just a few months ago when the two leaders were trading threats and insults over North Korea’s development of nuclear weapons and ballistic missile tests. In March, Trump unexpectedly accepted the offer of talks after the North Korean dictator agreed to suspend nuclear and missile tests and discuss “denuclearization.”

White House Press Secretary Sarah Sanders said in a statement that Trump “appreciates leader Kim Jong Un’s action to release these American citizens, and views this as a positive gesture of goodwill.”

She added, “The three Americans appear to be in good condition and were all able to walk on the plane without assistance.”

Also Wednesday, Trump spoke with South Korean President Moon Jae-in, the White House said. ”The two leaders welcomed North Korea’s decision to release three American detainees, and expressed hope for joyful family reunions.”

Kim Dong Chul, a South Korean-born U.S. citizen, is the longest-serving detainee among the three.

According to North Korea’s state media, Kim, 64, ran a company in the North’s northeastern Rason special economic zone before his arrest on Oct. 2, 2015. He received a 10-year prison term with hard labor in April 2016 for allegedly “perpetrating state subversive plots and espionage against” North Korea.

Before his sentencing, the former Virginia resident publicly apologized for slandering North Korea’s leadership, collecting and passing confidential information to South Korea, and joining a smear campaign against the North’s human rights situation.

Other foreigners have been presented at news conferences in North Korea and admitted crimes against the North, but many said after they were released that their confessions were given involuntarily and under duress.

Tony Kim, who also goes by the Korean name Kim Sang-duk, was detained on April 22, 2017, at the Pyongyang airport for committing “criminal acts of hostility aimed to overturn” North Korea, according to the North’s Korean Central News Agency.

It didn’t say what specific criminal acts Kim was alleged to have committed.

Kim taught accounting at the Pyongyang University of Science and Technology, which has been the only privately funded college in North Korea since its founding in 2010 with donations from Christian groups.

The school said Kim’s detention had nothing to do with his work at the university.

He previously taught Korean at Yanbian University of Science and Technology in Yanji, China, not far from the North Korea border.

Kim graduated from the University of California, Riverside, with a master’s degree in business administration in 1990.

He made at least seven trips to North Korea to teach. His wife accompanied him on the visit when he was arrested. She was allowed to leave the country.

Kim Hak Song worked in agricultural development at an experimental farm run by the Pyongyang University of Science and Technology. He was detained on May 6, 2017, for engaging in unspecified “hostile acts” against North Korea, KCNA reported.

It didn’t say whether his case was related to Tony Kim’s.

The university also said his detention wasn’t related to his work at the school.

It wasn’t known whether Tony Kim and Kim Hak Song were formally convicted and sentenced.

They are the latest in a series of Americans to be held in North Korea for alleged anti-state activities in recent years, only to be freed during the visit of a high-level U.S. official or statesman.

American detainee Otto Warmbier died in June 2017 — just days after he was brought back to the U.S. with severe brain damage. He was arrested in January 2016 and accused of stealing a propaganda poster and was sentenced to 15 years in prison with hard labor.

His parents, Fred and Cindy Warmbier, have filed a wrongful death lawsuit, accusing the government of torturing and killing their son.

“We are happy for the hostages and their families,” the Warmbiers said in a statement Wednesday. “We miss Otto.”

Fox News’ Kristin Brown, Nick Kalman, John Roberts and The Associated Press contributed to this report.