Arson and poison attacks on schools across Afghanistan, mostly against those teaching girls, have forced students to defend themselves, an extra-curricular activity imposed by the government which blames the Taliban for the violence.
Abdul Fatah, 16, takes it in turn every few weeks to stand guard all day at the entrance to Habibia High School, one of the best in Kabul.
His parents worry that if there is an attack, he will be the first to get hurt. But the only other choice is to stay at home and join tens of thousands of Afghans who have left school early and struggle to earn a living in menial jobs.
There is a police checkpoint on the road outside and each day a group of six students and a teacher patrol the grounds.
"We are on the front line," Abdul said. "If there is an attack, it will be us who get hurt. But somebody has to do the searches."
Schools have been burnt across the country, hundreds of children hospitalized after drinking contaminated water and teachers attacked, whipping up a climate of fear reminiscent of Taliban rule from 1996 to 2001. The Taliban banned education for women and girls and only allowed strict Islamic instruction.
Unidentified men threw acid on a group of 15 girls as they walked to their school in the southern city of Kandahar in November 2008 when the Taliban insurgency was rising, triggering alarm across the country. There haven't been reports of big attacks since then, but women have been wounded with acid over other issues.
Girls have been returning to school, especially in the capital, Kabul, since the overthrow of the Taliban, in one of few hard-fought gains in civil liberties.
Afghanistan's intelligence agency, the National Directorate of Security, says the Taliban are bent on closing schools ahead of the withdrawal of foreign forces in 2014. Some of the attacks are carried out by Taliban members and in some cases, it says, the Taliban have used children to poison fellow pupils.
On Wednesday the agency said it had arrested 15 people for a spate of attacks in northern Takhar province, most of them Taliban, but also two girls who it said had been given 50,000 afghanis ($1,000) each to smuggle in toxic powder and slip it into the water tank.
One of the girls, Sima Gul, a grade 12 student, said in a video released by the agency that she had also been forced to spray poison in her classroom by a relative in the Taliban who had repeatedly followed her to school.
"He threatened to kidnap me and kill me if I didn't do this," she said, her voice breaking. "I am ashamed."
But the Taliban have denied involvement, saying the attacks, arrests and confessions are part of a propaganda campaign to blacken their reputation.
"We are not opposed to education. Why should we oppose it? Our children attend these schools. We are only against schools that propagate anti-Islamic teachings, that are opposed to Afghanistan's national sovereignty," said Taliban spokesman Zabihullah Mujahid.
He said militia groups set up by the government were behind the violence. Others hint at external forces trying to whip up trouble as Afghanistan prepares to take responsibility for its security after nearly 11 years of international support.
Some 550 schools in 11 provinces had been closed because the state could not provide enough security, Amanullah Iman, a spokesman for the Education Ministry, said.
In the southern province of Helmand, more than half the 336 schools are shut. Last week, anonymous letters delivered at night in the southeast insurgent stronghold of Paktika warned children and teachers of punishment if they attended school.
The closures have left about 200,000 children, mostly girls, without any access to education, and strengthened fears that Afghanistan's fledgling national forces may be unable to preserve women's rights once international forces leave.
"Over the last two years, the Taliban have moved away from large set-piece combat maneuvers and focused more on intimidation and social and political control," said Joshua Foust, an expert on Afghanistan and Central Asia at the Washington-based American Security Project.
"Shutting down schools is one way of establishing control."
Alarmed by four poison attacks over the last two months on girls' schools, authorities in northern Takhar province last week ordered headmasters to remain in school until late in the evening and staff to scour the grounds for suspicious objects and test the water before opening the school gates.
Girls go to school in groups of five to ten seeking safety in numbers. Some don't dare to take in food or water in case someone poisons it, said Hamida, who is 19 but still in high school because of so many stops and starts to her education.
"To be honest, we are very scared each day. If you see someone staring at you on the way to school, you know there can be trouble," she said.
Sometimes the children simply turn back for home, fearing an attack.
Takhar was transferred to Afghan government control in April as part of a gradual transition. NATO said security had improved and Afghan forces were capable of shouldering responsibility.
But renewed violence across the nation as part of the Taliban's spring offensive has stoked fear that the poorly equipped Afghan forces may struggle to establish control.
Takhar has been a hotbed of militancy and criminal activity since 2009. It's not just the Taliban but also small ethnic insurgent groups such as the Islamic Movement of Uzbekistan that are active.
Even in the best of times, NATO barely managed to keep the lid on the tension within the province, officials say. The risks have risen even more now that the reins have been handed to the Afghan army.
"Now that it's under Afghan control, we're seeing what I expect we'll see in a lot of places: all the many armed groups vying for control," Foust said.
"Someone will eventually come out on top if they're left to their own devices ... it just might not be someone we'd prefer."