The dimming daylight in the courtyard outside told me that it would soon be time to leave. My fellow researcher and I needed to be back in Kabul before dark, and I pictured him outside—with the driver—checking his watch.

But when “Laila” opened up a photo album on the cushions where we sat, I moved closer. Here was a birthday party in Kabul, she explained, pointing to women with styled hair and eye shadow. A plate of sweets, family members smiling. Her father, a doctor, before he was killed by rockets. Laila and her husband had moved to his family’s land in a village in a province southwest of Kabul to escape fighting in the capital in the 1990s. The pictures were evidence, she showed me, that her life was not always like this.

“This” was her family’s mud-brick compound right across from an abandoned school building where Laila had been a teacher. I had come there to ask her about the school.

Laila says that when she first came to the village, people assumed she wasn’t educated and only later learned she had completed grade 14 (postsecondary technical training). After the Taliban government’s ouster in 2001, villagers asked her to run a school. “At first my husband and other family didn’t want me to become a teacher because, they said, ‘You will be killed,’” she says. “But I started despite these problems.”

Months before I met her in late 2005, Laila’s school had grown to nearly 200 girls in grades 1–6. But one morning in September, at about 7 a.m., as the first children were arriving, they discovered a clock in one of the classrooms. Laila went to investigate, and found that the clock was connected to an explosive device: “The clock was set for 9 a.m.,” she says. It was a little bit far away from the mine. There were wires connecting it to the bomb. The mine was round. It was put on the side of the class. A bag was put on it. . . . I started taking students out of the school and sent my son to call his father.”

That afternoon international forces came and exploded the mine in a field.

Laila forbade her children from returning to the building, but with her fellow teachers moved the classes into the courtyard of her home. No one considered this a real solution, she says: “We see the commitment of villagers to keeping the school. We want the authorities to provide security for the school so we can continue to work.”

Dozens of teachers, students, and local education officials told us the same thing that year—they desperately needed security. Just in the six months after I met Laila, my organization, Human Rights Watch, documented more than 110 attacks on schools, teachers, and students in Afghanistan. Students and teachers were killed.

Since then we have traveled to about 20 other countries and reported that this is not just a problem in Afghanistan. In nearly every country in conflict, women and girls—as well as boys and men—are putting their lives on the line to teach and learn. Beyond the dangers of crossfire, especially if troops move into their schools, many are being intentionally targeted as a tactic of war.

According to the Global Coalition to Protect Education from Attack, a coalition of nongovernmental organizations and United Nations agencies, at least 30 countries have experienced a pattern of attacks on education institutions, teachers, and students in the last eight years.

Some are now well known, like Malala Yousefzai, whom the Pakistani Taliban shot because she wouldn’t stop fighting for girls’ education, and the schoolgirls of Chibok, Nigeria, who were abducted by the armed group Boko Haram when they returned to school to take exams.

Others known by only a few, like 13-year-old “Deka” from Somalia, who told me about her last day of elementary school in Mogadishu. Fighters from the armed Islamist group Al Shabab burst into her classroom. “We want this boy, this girl,” they demanded, taking two boys and three girls, who never came back. The group, we found, abducted boys to fight and abducted girls to cook and clean, and for forced “marriage” and rape.

Where children and their schools are targeted, I’m not surprised when parents tell me they have decided to keep their children home. As a parent myself, I wonder what risks I would be willing to take. In a dangerous climate, choosing not to send children to school can be a wise choice. “One thing is culture,” Laila told me. “The other is security.”

But many parents see the loss of education as the loss of a future. Some are mothers, like the woman I met one stifling night in Sri Lanka. She had just fled with her family as the government dropped bombs on her village in a rebel controlled area, and was being directed into an A-frame tent—one of a dozen hastily set up on a playground—that was already occupied by another family. Her question for me? How her son could take his upcoming matriculation exams and not miss the chance to continue studying.

Refugees from Syria and elsewhere landing on the shores of Europe have told us that accessing education was a key factor in their desperate decision to board an overcrowded, dangerous boat. Adnan, 16, from Damascus, told my colleague in Greece: “I cannot live in Syria. I cannot continue my studies. We can’t walk safely on the street. We can’t guarantee our lives. They attack the schools, they attack the mosques. My school was bombed. A plane attacked it at night. One month later, we moved to Quneitra. A year after we arrived, that school was destroyed too.”

With some 250 million children living in countries affected by conflict, according to the United Nations Children’s Fund (UNICEF), and Syrian families seeing no hope for the future in neighboring countries where half of Syrian refugee children are not in school, education should not be an accepted or inevitable casualty of war.

Teachers, local education officials, and aid workers who have lived with the problem for years are, in various places, building higher walls, establishing home-based schools, negotiating with local armed groups, or escorting teachers and students. But they need support—and action—at higher levels.

They need credible investigations from their governments and prosecutions for unlawful attacks. Many also need their armies to stop using their schools for military purposes, such as for barracks, bases, training grounds, and detention centers.

Military use of schools creates a wholly inappropriate environment for education, with risks for recruitment and sexual harassment and violence, and other problems like drinking, drug use, and interrogation of suspects, all of which are dangerous to children. Not surprisingly, when armed men move in, girls are typically the first to drop out. Even worse, a military presence can turn the school into a target for the other side, and, as a result, students and teachers have been killed, and school buildings damaged and destroyed.

Most troops receive no orders to avoid using schools—or training to find alternatives—and schools have been used for military purposes in most conflicts in recent years.

The UN Security Council has spoken out against attacks on schools and their military use, and “encourage[d] Member States to take concrete measures to deter such use of schools by armed forces and armed groups.” The Security Council has specifically demanded that schools in Syria be demilitarized.

The UN Secretary-General has also started adding to his annual “list of shame” for grave violations against children, and those warring parties who attack schools and teachers.

Perhaps most significant is the development of the international Safe Schools Declaration, a political commitment by countries to protect education during war. Less than two years after the declaration was launched, 56 countries—and counting—have signed. These include countries from every region of the world, half of all members of the European Union, countries in conflict, and countries at peace.

A number of countries are taking steps to put their promises into action. For example, the Democratic Republic of Congo’s Defense Ministry has banned using, requisitioning, or destroying schools, and promised criminal and disciplinary sanctions for troops failing to comply.

The UN Department of Peacekeeping Operations in 2012 banned peacekeeping troops from using schools. And 19 nonstate- armed groups have signed a Deed of Commitment for the Protection of Children from the Effects of Armed Conflict, negotiated by the group Geneva Call, which includes a promise to avoid using schools.

In the face of terrible school attacks continuing in Syria and elsewhere, these are all signs of new—and promising—momentum to make many schools safer for children during war.

But much more remains to be done. More countries should sign the Safe Schools Declaration and take steps to prevent schools from being attacked, including not using them for military purposes. The United States and a number of other countries with well-resourced militaries that should be well-placed to avoid taking over children’s schools have not signed.

International donors to education should care as well. Our researchers visited a Swedish-government-funded school in Afghanistan that was left in ruins last year when government forces attacked Taliban troops based there. Afghan government forces have also used schools as military bases. Funding for schools should include pressing recipients wherever possible to restrict their use by the military.

Those responsible for attacking and using schools should face real penalties, including public shaming, the loss of funding, and criminal sanctions. The International Criminal Court has jurisdiction over wartime attacks on education institutions—for the right case, such charges would send a powerful message.

As I sat with Laila back in 2005, before we finished looking at the album, a child came to the doorway with a note from my colleague—it was really time to get on the road. Laila closed the book but touched my arm. She was scared, she says, but “I’m a soldier.

I’m running this school and I have housework and six children. . . . It’s a challenge for me and I will never stop this school.”

Teachers like Laila and students like Deka are working so hard—and taking such great risks—for education. They should be able to count on the rest of the world to support them.