The rape accusations brought out in the open a deeply embedded practice by powerful male figures who keep boys as sexual slaves. The Afghan authorities are reluctant to acknowledge or discuss the rampant sexual abuse of boys, which is a crime in Afghanistan as it is around the world. But it also is a practice that dates back centuries in the country.

On the video, the National Directorate of Security said Mr. Musa’s allegations were “baseless, without proof and without evidence.” The agency said the accusations had caused “public unrest” and “could even deprive our children of their education.”

Looking drawn and anxious, Mr. Musa said on the video that his allegations were untrue and his investigation “incomplete.”

“It was a mistake,” he said, speaking with his head down. “I apologize to the people and the government.”

The other detained Logar activist, Ehsanullah Hamidi, also spoke briefly on the video. The two men were detained one week after Mr. Musa was interviewed by the Tolo news channel in Afghanistan on Nov. 14. Besides The Times, the Guardian newspaper of Britain also has reported on Mr. Musa’s allegations.

A friend and a relative of Mr. Musa’s who said they had spoken with him shortly before he was detained last Thursday said he had gone to speak to officials at the American Embassy in Kabul. They said he was detained shortly after leaving the embassy, while en route to meet with the European Union’s ambassador in the capital.

Amnesty International warned Monday that the two detained activists were at risk of torture “and other ill-treatment” as long as they remained in custody.