North Korea has confirmed for the first time that a U.S. soldier who crossed into the country last month was in its custody, saying that he had sought refuge there or in a third country due to "inhuman maltreatment and racial discrimination” in the U.S. Army, state-run media reported Wednesday.

U.S. Army Pfc. Travis King crossed the Military Demarcation Line into North Korea during a tour to the Joint Security Area in the Demilitarized Zone separating the two Koreas on July 18.

The official Korean Central News Agency said King had “admitted that he illegally intruded” into North Korean territory, echoing U.S. officials’ statements that he was believed to have crossed the border intentionally.