KABUL (Reuters) - Afghanistan on Wednesday released two civil society activists arrested after exposing alleged sexual abuse of hundreds of school children, following pressure from the United States and international human rights groups.

FILE PHOTO: John Bass, the United States ambassador to Afghanistan, attends a conference at the United Nations in Geneva, Switzerland, November 27, 2018. REUTERS/Denis Balibouse/File Photo

The Guardian newspaper reported earlier this month that a pedophile ring was involved in abuses of at least 546 boys from six schools in Logar province, south of the capital Kabul.

Mohammad Musa, a leading rights activist who was investigating the case and quoted by the newspaper, was detained by National Directorate of Security (NDS) personnel along with his colleague Ehsanullah Hamidi last week on the way to Kabul.

A senior Afghan government official overseeing the case said Musa and Hamidi had been released and handed over to the Afghanistan Independent Human Rights Commission on Wednesday.

On Tuesday, the NDS said the two had been moved to a safe location because of threats to their lives. It accused them of admitting during interrogations that they had made up the allegations in order to get asylum in a foreign country.

In an NDS video released the same day, Musa was seen saying his research was incomplete and he made a mistake - a confession rejected as “Soviet-style” by U.S. Ambassador John Bass.

“It’s appalling to coerce confessions from civil society activists,” Bass said in a tweet, calling for both to be freed.

London-based rights group Amnesty International had also called for the immediate release of Musa and Hamidi and said they were at risk of torture and ill treatment.

“Rather than punishing them for speaking out against these horrific crimes, the authorities should praise them for their work and hold the suspected perpetrators accountable,” said Samira Hamidi, an Amnesty South Asia campaigner.

President Ashraf Ghani said on Tuesday he was “deeply disturbed” by the sexual abuse reports and that he had ordered the education ministry to undertake a thorough investigation and report back to him as soon as possible.

According to the Guardian report, some of the victims have been killed by their families or unknown perpetrators after being identified as victims of sexual abuses.

In a country where half of the population is younger than 15, Afghanistan’s 18-year war since the Taliban regime was toppled has arguably hit children the hardest. Some 927 children were killed in the conflict last year, according to UN report.

Children have been used as soldiers by all warring parties in Afghanistan and human rights groups have reported that some have been sexually molested by Afghan military or police personnel, or used as suicide bombers by Taliban insurgents.