SEOUL, South Korea — North Korea released a South Korean citizen on Tuesday who was detained in the North last month, a rare humanitarian gesture welcomed by the South Korean government.

The returnee was handed over to the South Korean authorities through Panmunjom, a contact point on the border between the two countries, the South’s Unification Ministry said in a statement.

The 34-year-old man, who was identified only by his last name, Seo, was arrested in North Korea for illegal entry on July 22.

The ministry released no further details, citing a pending investigation. The man will probably face criminal charges in South Korea because of a national law that bars citizens from visiting the North without government permission.