A U.S. soldier who illegally crossed the border into North Korea this summer has been released to U.S. custody. Travis King, whose unauthorized entry into North Korean territory created a diplomatic crisis, was expelled from the country and delivered to United States officials on Wednesday after spending over two months in the reclusive country.

The international drama concerning 23-year-old Army Private 2nd Class Travis King began on July 18 when King intentionally crossed the heavily militarized border between South and North Korea. King had been stationed in South Korea, which has maintained a heavy U.S. military presence since the 1950-1953 Korean War, but was set to be flown back to the U.S. to face disciplinary action from the U.S. Army. Instead, King snuck away from the airport in Seoul and made his way to the Demilitarized Zone between the two Koreas, allowing him to cross over to the Democratic People’s Republic of Korea, as North Korea is officially known. Once there, he was detained by North Korean officials who interrogated him. Eventually, North Korean officials declared King guilty of “illegally intruding” into the country’s territory and decided to expel him.

American officials say that King’s release was the outcome of “intense diplomacy” that has occurred between a number of countries since the soldier entered North Korean territory. Sweden, which has often played a role as a diplomatic middleperson between the United States and North Korea, helped to negotiate King’s release. Meanwhile, China — which borders North Korea and is one of the country’s few allies — allowed King to be transferred to its territory en route to his return to the U.S. A senior official in the Biden administration was adamant that the U.S. had not granted any concessions to North Korea in exchange for King’s release. “The answer is simple: There were none. Full stop,” the official said, according to CNN. A spokesperson for Claudine Gates, King’s mother, said in a statement that she “will be forever grateful to the United States Army and all its interagency partners for a job well done” and asked for privacy for their family.

The reasons for King’s decision to flee to North Korea have not been clear. Many have speculated that he was attempting to escape disciplinary action related to two offenses he allegedly committed in South Korea in 2022. In September 2022, King was accused of punching a man outside a club several times, according to court documents, per the New York Post. A few weeks later, King was arrested for another altercation and damaged a police patrol car as he was taken into custody, according to court documents. King pleaded guilty to both charges, per the Post. He was fined by South Korean officials and held in military detention over the incidents, and he was getting ready to be sent back to the U.S. when he escaped into North Korea.

North Korean officials, meanwhile, painted King’s actions as a plea for asylum. An August statement released by North Korea’s official news agency said that King “confessed that he had decided to come over to the DPRK as he harbored ill feelings against inhuman maltreatment and racial discrimination within the U.S. Army.” The statement added that King “was disillusioned at the unequal American society,” but did not elaborate on his views or motives.

It is unclear what charges, if any, King will face as he returns to the United States. After his long ordeal, however, American officials told CNN that “King was very happy to be on his way home.”