Pakistan said yesterday it had rescued 20 young boys who were among hundreds recruited by the Taliban and brainwashed into becoming suicide bombers at a secret indoctrination camp.

The boys, some as young as nine, have revealed details of how they were induced to become part of the Taliban's army of jihad inside Pakistan and told their rescuers that more than 1,000 children may be undergoing training in the special camp in the Swat valley. Their discovery by the army as troops were sweeping through the valley conducting the final stages of a military offensive against the Taliban underscores the organisation's power over poor Pakistani communities and the extreme lengths Taliban commanders are willing to go to achieve their aims.

The rescued children were held at a training camp in the Charbagh area of the Swat valley, where their indoctrination programme reportedly lasted more than a month. Some were recovered as the army was carrying out "search and sweep" operations as part of the final stages of its military offensive in the valley, while others were handed over to the army by worried parents.

Download the new Independent Premium app Sharing the full story, not just the headlines

"When we interrogated the boys, they said that they had been taken hostage by the Taliban by force, or in some cases they were taken to the training camps by their friends," said Major Nasir Khan, a military spokesman in the Swat valley.

"They were heavily indoctrinated. When I asked them about what they were told, they said: 'The Pakistan army is the ally of the Western capitalist world, they are the enemies of Islam. The fight against them is justified, they are apostates, the friends of the infidels.'"

The boys arrived at the camp by a variety of different routes. Some families had been forced at gunpoint to hand over their children "to fight jihad" during the Taliban's brutal advance across Swat over the last two years. Some groups of young boys were kidnapped in mysterious circumstances, while others were lured in to the Taliban's clutches by the persuasion of their friends.

The precise number of boys detained and trained by the Taliban is unclear, but is believed to run in to the high three figures. One of the 20 boys recovered told Major Khan that there were "about 1,200 other boys" at the training camp in Charbagh. The army suspects that there were other camps in operation elsewhere in the valley, including the militant stronghold of Piochar.

The boys now in the army's hands have started to give details of the training they underwent at the camps. First it appears they were indoctrinated ideologically: they were shown videos of atrocities being carried out across the Muslim world, from Palestine to Chechnya and the Middle East. "They were shown these images to develop a hatred of Western countries," said Major Khan.

The Taliban militants would then gauge their levels of intelligence and physical strength before dividing the young boys into separate categories. The first group was used as local informers who would patrol the streets of the valley gathering information. One of the boys interrogated said he was given a pistol and told to monitor the Pakistan army's troop movements.

As the army began to strike at the Taliban's communications infrastructure, destroying their ability to communicate by satellite phone and capturing known local informants, the militants fell back on simpler methods: young boys were posted on street corners and when an army convoy began to roll in their direction they would send signals to boys further on by mirrors or hand signals.

While boys selected to be informers were chosen for their intelligence and street knowledge, the more athletic ones were picked to train as the next generation of Taliban fighters, and instructed in how to mount the sort of small-scale guerrilla attacks with which the Taliban have been harrying the Pakistan army during their two month-long offensive in the valley. Meanwhile, those who were judged to be less intelligent and more susceptible to manipulation were chosen to join the Taliban's stockpile of suicide bombers. According to the young boys interrogated by the army, this group was kept separately and prized for their potential to cause large army fatalities.

As the Taliban faced mounting losses and began to scatter under the army's offensive, in dribs and drabs the children returned to their homes in different parts of the valley – but with their Taliban indoctrination intact. Many parents were appalled at the changes their children had undergone. "The militants had told the boys that they had the right even to kill their parents if they stood in their way," said Major Khan.

The army has appealed to parents across the valley to hand over sons who spent time in the Taliban's camps. A special school is being established in Swat to rehabilitate the children, to re-educate and counsel them, and give them small grants to be able to seek jobs once they have recovered.

The army claims that it has cleared Taliban fighters in all but a few pockets of the valley. While more than 1,500 militants are said to have been killed, the Taliban commander in the valley, Maulana Fazlullah, is at large. One quarter of the two million displaced have returned to their homes. But many others hesitate to return, fearing that the Taliban could return in strength.