Aijalon Gomes, the US citizen jailed by North Korea for illegally entering the country early this year, has been freed after being granted a special pardon.
Gomes, 31, flew out of Pyongyang on Friday on a private jet with Jimmy Carter, the former US president, who secured his release following negotiations.
State-run Korean Central News Agency in reporting Carter's departure said he apologised for Gomes' actions.
Gomes, who was arrested in January and accused of crossing into North Korea illegally from China, is the fourth US citizen in a year detained for allegedly
sneaking into the communist country.
The pardon "to set free the illegal entrant is a manifestation of [North Korea's] humanitarianism and peace-loving policy", the agency said.
Al Jazeera's Steve Chao, reporting from neighbouring South Korea's capital Seoul, said that North Korean officials told Carter that they would like to see the Korean peninsula denuclearised to further ensure peace.
"The key moment was a meeting between Jimmy Carter and North Korea's number two man Kim Jong-Nam. In that meeting Kim expressed North Korea's desire to denuclearise the Korean peninsula and also to resume the six-party talks - talks aimed at dealing with the nuclear issue.
"And that is key here because tensions on the peninsula have been extremely high following the sinking of a South Korean naval warship in March.
"There were questions as to whether Carter would be given some kind of diplomatic message to be taken home. That seems to be the case."
North Korea and the US have no established diplomatic relations.