Family members and friends of the American men who were held in detention in North Korea said Thursday that they are thankful for their release and grateful to have them back in the U.S.

The men —Tony Kim, Kim Hak Song and Kim Dong Chul — were greeted by President Donald Trump in a middle-of-night homecoming ceremony at a military base in Maryland.

Tony Kim, who also goes by the Korean name Kim Sang-duk, was detained in April 2017, at the Pyongyang airport and was accused of committing "criminal acts of hostility aimed to overturn" North Korea. He taught accounting at the Pyongyang University of Science and Technology, which is the only privately funded college in North Korea.

In a statement, Kim's family said they were grateful that the three men were released and thanked Trump for engaging directly with North Korea.

"Mostly, we thank God for Tony's safe return," the statement said. "We ask that you continue to pray for the people of North Korea and for the release of all who are still being held."

Kim Hak Song, who was detained a month later, in May 2017, had worked in agricultural development at an experimental farm run by the same college. He was detained after being accused of unspecified "hostile acts" against North Korea.

He had studied at World Mission University in Los Angeles and was affiliated with the Oriental Mission Church in the city's Koreatown neighborhood.

The church, which referred to him as Kim Hak-sung, said in a statement that he was devoted to ministry and was detained by North Korean authorities after he was caught trying to return to his home in Dandong, China.

The church said its members had prayed for the last year so Song "could safely return to his family."

Pyongyang University of Science and Technology has said the men's detention wasn't related to their work at the school.

Kim Dong Chul, a South Korean-born U.S. citizen, had reportedly run a company on North Korea's border with Russia. The former Virginia resident had been sentenced in April 2016 to 10 years in prison with hard labor after being convicted of espionage.

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

Many other foreigners who admitted to crimes against North Korea at news conferences have said after their releases that their confessions were given involuntarily and under duress.