And when Americans face that grueling sentence -- often for questionable reasons -- there's no easy way to get them out.
It's a significant move, since negotiating with a totalitarian regime is challenging -- and it's not always successful.
Here's a look at some of the unique methods used to free detained Americans in North Korea:
Euna Lee and Laura Ling
Date of capture: March 17, 2009
Reason for detention: The two American journalists were charged with entering North Korea illegally to conduct a smear campaign.
Sentence: 12 years of hard labor each, with no chance for appeal.
How they were freed: In August 2009, former President Bill Clinton made a private trip to Pyongyang and met with then-leader Kim Jong Il to try to secure the journalists' release.
North Korea claimed that Clinton had "expressed sincere words of apology." Clinton also had to sit for three hours of dinner and photos with Kim Jong Il
The next day, Lee and Ling were pardoned and released.
Date of capture: Late 2012; in December 2012, US officials said Bae had been detained for over a month
Reason for detention: Bae, a tour company owner, was in North Korea for work. The regime arrested and charged him with "hostile acts" against the country and accused him of setting up bases in China for the purpose of "toppling" the North Korean government; encouraging North Korean citizens to bring down the government; and conducting a "malignant smear campaign."
State media also claimed Bae had planned to bring down North Korea through religious activities.
15 years of hard labor, which started to take a severe toll on Bae's health
How he was freed: Bill Richardson, a former US ambassador to the United Nations, was the first dignitary to go to North Korea on Bae's behalf, in January 2013. But he struck out.
"I'm calling on the Supreme Leader of North Korea, or as I call him, "Kim," to do me a solid and cut Kenneth Bae loose," Rodman tweeted in May 2013.
That didn't work, either. At least not immediately.
Fast forward to January 2014, when CNN's Chris Cuomo asked Rodman about his recent trip to North Korea and about Bae. Rodman went on a tirade against Bae
, but later apologized, saying he had been drinking
In November 2014, Bae and fellow American Matthew Todd Miller
were released after James Clapper, then the US director of national intelligence, went to Pyongyang and delivered a letter from President Barack Obama
Later, Bae actually credited Rodman's tirade for bringing attention to the case.
"I thank Dennis Rodman for being a catalyst for my release," Bae told CNN
Aijalon Mahli Gomes
Date of capture: January 25, 2010
Reason for detention: Gomes, a former English teacher in South Korea, was accused of entering North Korea illegally from China.
Sentence: Eight years of hard labor and 70 million North Korean won ($600,000).
How he was freed: Former President Jimmy Carter went to Pyongyang in August 2010 to try to get Gomes released. Two days later, he left the country with Gomes. Kim Jong Il had granted Gomes amnesty.
Date of capture: January 2, 2016
Reason for detention: Warmbier, a University of Virginia student, was accused of committing a "hostile act" against the government. Later, the government released a video of Warmbier apologizing and confessing to "the crime of taking down a political slogan from the staff holding area of the Yanggakdo International Hotel." But it's not clear whether Warmbier was forced to speak.
Sentence: 15 years of hard labor, though he has been in a coma for the past year.
How he was freed: The diplomatic process began on June 6, when State Department Special Representative Joseph Yun met with North Korean UN Mission Ambassador Pak Kil-yon in New York and learned of Warmbier's deteriorating health condition, a senior State Department official said.
After that meeting, Secretary of State Rex Tillerson consulted with President Donald Trump and instructed Yun to prepare to travel to North Korea with the intent of bringing Warmbier back to the United States, the official told CNN.
Yun and a medical team were sent to North Korea on Monday to secure Warmbier's release, the official said, and Yun demanded Warmbier be released on humanitarian grounds.
Warmbier's release happened the same day Rodman began a visit to the country, but a US State Department source said Rodman had nothing to do with the release
Warmbier's return to the United States will be bittersweet. The 22-year-old contracted botulism and is in "bad shape," a source close to the family told CNN.
"Otto has left North Korea. He is on Medivac flight on his way home," his parents said in a statement Tuesday. "Sadly, he is in a coma and we have been told he has been in that condition since March of 2016. We learned of this only one week ago."
Three other Americans still detained
Despite efforts to get them released, three Americans are still detained by the North Korean regime.
-- Kim Dong Chul
, a naturalized American who worked in international trade, was arrested in October 2015 on suspicion of espionage.
Six months later, the regime claimed he had confessed
to espionage charges, though it's not clear whether he made those statements under duress.
Kim Dong Chul has been sentenced to 10 years of hard labor.
He taught at Pyongyang University of Science and Technology, a privately run school that has dozens of foreign faculty
-- Kim Hak-song
, another American professor, was arrested May 6 on suspicion of "hostile acts" against the regime.
He ran projects aimed at improving agricultural yields at Pyongyang University of Science and Technology, former classmate David Kim said.
"As he struggled to fund some of his projects, he would spend money out of his own pocket," David Kim said.
David Lee, who said he studied with Kim Hak-song in the United States, said Kim Hak-song would send food to North Korea. Kim had been very concerned about the food shortage in North Korea. Lee said.
"North Korea is persecuting their savior, a person who came to help them," Lee said. "This is wrong."