The military says it has killed more than 1,700 fighters and cleared most parts of the mountain region, located just 100 km from the capital, Islamabad.
Fierce clashes made around two million people flee to adjoining districts, where the government accommodated around 275,000 of them in 4,739 school buildings and several makeshift camps.
Shah said Thursday that the refugees had left more than 1,100 schools, while the rest of the buildings would also be vacated within the next two weeks.
Regional authorities are assessing the situation to rehabilitate the structures before the official school year starts Sep 1.
'Getting all children back into learning environments poses a massive challenge to the government and the humanitarian community,' the Unicef spokesman said.