GHALANAI, Pakistan — The classroom in Ghalanai, an area nestled amid the mountains of Pakistan’s tribal belt, has the air of a military camp: a solitary tent pitched beside a bombed-out building, ringed by a high wall and protected by an armed gunman.

“We need to assure parents that it’s safe,” said Noor Haider, a local tribal leader who took on school security after Taliban militants bombed the school three years ago.

Extreme measures have become necessary as Taliban militants have pressed their violent campaign against girls’ education in northwestern Pakistan, bombing schools and terrifying pupils and parents.

More than 800 schools in the region have been attacked since 2009, according to government education authorities. But it was a vicious attack last October on an outspoken 15-year-old schoolgirl, Malala Yousafzai, that moved the issue to global prominence.