The courage of schoolgirl Malala Yousafzai has renewed Pakistani students' determination to learn despite the poor state of the country's education system, undermined by poverty and under attack from Islamist militants.
The 15-year-old is recovering in a British hospital after the Pakistani Taliban shot her in the head in a cold-blooded murder attempt for daring to promote the right of girls to go to school.
The October 9 attack came in Malala's hometown Mingora in Swat, part of Pakistan's restive northwestern province Khyber Pakhtunkhwa, where insurgents bitterly opposed to a secular curriculum -- and girls' education in particular -- have destroyed hundreds of schools in recent years.
Militants have destroyed four schools in the last week alone, according to officials -- two on Wednesday in Mohmand tribal district and two more in Khyber Pakhtunkhwa.
The provincial government says more than 700,000 students have been affected, though casualties are low as most school attacks happen at night when students are at home.
"The insurgents mostly target girl's schools and order both teachers and students to stay inside their homes as per their version of Islamic teachings or face the dire consequences," said provincial Information Minister Iftikhar Hussain.
Naseem Baigam, a teacher at the government-run Islamia Collegiate girls' high school in Peshawar, the main city of Khyber Pakhtunkhwa, told AFP the destruction of schools and the attack on Malala had frightened parents.
But students at the school said they were inspired by Malala, who rose to prominence with a blog for the BBC chronicling life under the Taliban, the hardline Islamists who terrorised the picturesque Swat valley from 2007 until an army offensive in 2009.
"It is disappointing that Taliban are destroying schools," Saba Riaz, a final year student, told AFP.
"Such attacks are disturbing but Malala has given us courage to fight for the cause of education."
Her friend Razia Khan agreed: "Girls will never be scared by such attacks. In any case we will continue our studies, even if they are destroying schools or attacking girls like Malala."
But it is not only militancy that schools in Pakistan have to contend with.
The nuclear-armed nation's spending on education is tiny -- less than 2.5 percent of GDP, according to the UN children's agency UNICEF. Only nine countries in the world spend less on education.
Pakistan's official literacy rate is 58 percent, with less than half of women able to read and write, yet in 2011-12 the government's spending on defence was more than 10 times greater than education.
The country of 180 million people languishes near the bottom of the world literacy list, 159th out of 184 countries categorised by the UN Development Programme.
A recent UNESCO report said at least 5.1 million Pakistani children are out of school -- 63 percent of whom are girls.
Pakistan Social and Living Standards Measurement (PSLM), a government survey, found gender disparity in education across the country, but most severe in Khyber Pakhtunkhwa and Baluchistan provinces.
In Kohistan district of Khyber Pakhtunkhwa just six percent of students are girls, and in Baluchistan's Dera Bugti the figure falls to one percent.
Poverty is also a factor. More than a fifth of the population is classed as poor by the government, though activists believe the figure could be closer to 30 percent.
"People are getting poorer, that is making us more illiterate and more hungry. The girl child becomes the first casualty of poverty and illiteracy," said Tauseef Ahmed Khan, of Karachi's Urdu University.
Free and compulsory education is a right of Pakistani children enshrined in the constitution, but for many parents a child at school is a child not earning money -- an estimated 3.3 million under-14s in Pakistan work.
"A poor family prefers to send a boy to school. Most families think educating girls is wasting money, which can be saved and spent on their marriages," Zohra Yousuf, who heads the independent Human Rights Commission of Pakistan, said.
Girls often leave school young to join their parents in cottage industries and most poor girls are married off as teenagers.
But some parents are determined that their own children should have a different future, and see Malala as a hero.
Mother-of-four Azra Shabbir, now 32, was just 14 when her father married her off, forcing her to leave school and work with her husband in a shoe factory.
"I have two girls, both are in colleges like their brothers. I want to see them literate, see them prosperous no matter how much hard work I have to do for this," she said with a glint of hope in her eyes.
"Our poverty haunts us like Taliban, but we can fight against it, like Malala did against Taliban," she smiled.