‘The Dancing Boys of Afghanistan’’ on PBS sounds like a heartwarming documentary, but unfortunately the lives of these juvenile entertainers is anything but. The “Frontline’’ investigation illuminates one more dark corner of that tragic country’s soul.

Afghan journalist Najibullah Quraishi infiltrates the subculture of “bacha bazi’’ — literally, “boy play’’ — in which poor or orphaned Afghan boys become the possessions of powerful men. They dress as women and dance to entertain at all-male parties; later they are used sexually by their masters and other men.

It’s “sexual slavery,’’ in the words of a United Nations official, a tradition so odious that the Taliban banned it. It’s also illegal. But in one of the ironies that seem so common in that country, it has made a comeback under the more Western-friendly government now in place.

Quraishi, who also reported for “Frontline’’ on “Behind Taliban Lines,’’ is courageous and crafty. He once fled Afghanistan in fear for his life after reporting on massacres during fighting against the Taliban. Now he somehow convinces several powerful men in the city of Takhar that he is making a sympathetic film comparing Afghan and European bacha bazi practices. They allow him to film bacha bazi parties and interview the adolescent boys they “own.’’

Chief among these villains are a former mujahedeen commander-turned-car dealer named Dastager, whose leering admiration of the dancing boys is impossible to mistake for anything wholesome, and a scarily quiet, dead-eyed musician who trains the boys. That the musician is named Rafi is another brutal irony, although he spells his name differently than the popular US children’s musician.

Eventually the men become suspicious of Quraishi’s motives and he leaves Afghanistan again. Still, with the help of other Afghans, he tries to free Dastager’s latest acquisition, an 11-year-old boy from a poor village family. That effort adds some suspense to the last third of “The Dancing Boys of Afghanistan,’’ but a happy ending for little Shafiq won’t change the power structure that protects the bacha bazi culture.

© Copyright 2010 Globe Newspaper Company.