Like leaves on a tree they would grow again, and even if a big branch like al-Qaeda was chopped off, "the tree remains", he said. The answer was to address economic deprivation and ignorance.
President Musharraf outlined his educational strategy of enlightened moderation, rejecting extremism in all forms. High quality teacher training, new text books and a mainstream curriculum were his priorities.
His comments came as he met pupils and teachers from five British schools on a 10-day trip to Pakistan after winning a multi-media competition.
The "Experience Pakistan" competition is funded by Pakistani-born businessman Mr Humayun Mughal, chairman of Akhter Computers, based in Harlow, Essex.
The winning schools were The Boswells school in Chelmsford, Essex; Billericay school, Essex; Ponteland high in Northumberland; Peterborough high and Leith Academy in Edinburgh.
The president answered every question bowled at him during a friendly discussion at his residence. One 15-year-old pupil asked how the two assassination attempts last December changed his life.
"I used to be quite independent, going to hotels after dinner for hot chocolate," said president Musharraf. "But my security people are not happy about that now."
He said he was encouraging equality between men and women and had a former headmistress, Zubeida Jalal, as his education minister. "A woman in a job is more honest and dedicated."
Afterwards Joe Bear, a pupil from Billericay school, said: "He was a genuine gentleman - he wasn't afraid to talk about difficult things."
www.experiencepakistan.org for entry to the 2005 competition