Mopti, Mali - Djan Diagahate was 12 years old last year when he watched a group of gunmen storm his village in central Mali and burn it to the ground.

His home and his school - everything he knew - were destroyed.

More:

Since then, he has been living in a small tent made of tarp and twigs at a camp for displaced people in Sevare, some 100km (62 miles) from his home in Ballanguine. Instead of going to school, he spends his days sitting around the Chirifila site with his family and other children displaced by the violence that has engulfed Mali and other Sahel countries in recent years.

Diagahate is not alone. An entire generation of children in the country and across the region has fallen years behind their grade level.

A surge in attacks and threats against public schools, teachers and students in Central and West Africa has led to the closure of more than 9,000 schools, including some 900 in Mali, leaving overall nearly two million children without proper education, according to the United Nations children agency (UNICEF).

The attacks often involve beatings and kidnappings of students and teachers alike, said Lauren Seibert, a children's rights researcher at Human Rights Watch, a US-based NGO.

"A large percentage of children have severe trauma linked to what they experienced in school," added Seibert, who has spent the last year documenting abuses in the region.

"The attacks are horrific."

Djan Diagahate, left, watched a group of gunmen storm his village in central Mali and burn it to the ground; Amadou Diagahate, right, is worried for his grandson who has been out of school for a year [Annika Hammerschlag/Al Jazeera]

The situation is especially volatile in Mali, Niger and increasingly in Burkina Faso, where ISIL (ISIS) and al-Qaeda-linked groups have annexed vast swaths of land that have long suffered from weak governance. Along the way, they have exploited intercommunal disputes and widely-held resentments towards local governments to incite violence and recruit new members.

Backed by international allies, state security forces have sought to quell the upheaval but muddled operations at times have killed more civilians than the militias themselves.

In those three countries, gold trafficking has financed the expansion of armed groups and provided access to a steady flow of ammunition, contributing to a six-fold increase in school closures since April 2017.

Goldmines that were neglected by local governments have fallen prey to fighters who see Western-style education, particularly for girls, as a threat to their ideologies.

"Control of the mining sites allows them to extend their influence and gain more funding," said Jean-Herve Jezequel, the director of the Sahel project for Crisis Group, a conflict research nonprofit. "The mines are full of young men who can be easily recruited into jihadi groups."

Recruited by armed groups

Local security forces lack the resources needed to combat rebel groups, particularly in rural areas where their authority is challenged, according to Crisis Group.

Since 2015, the number of violent attacks perpetrated by "militant Islamist groups" in the Sahel has doubled each year, the Africa Center for Strategic Studies, a US Department of Defense research group, said in December 2019. Deaths linked to these attacks have also doubled each year.

In Mali, the conflict has grown largely out of mounting tensions between the Peuhl (also known as Fulani) and Dogon ethnic groups, much of which is stoked by armed groups and exacerbated by competition over the shrinking availability of arable land due to climate change.

Each year is worse than the last: with more than 450 documented killings, 2019 was the deadliest year for civilians in central Mali since the conflict began escalating in 2012, according to Human Rights Watch.

Attacks against Malian children are also on the rise. The first three quarters of 2019 saw some 570 serious violations against children, compared with about 390 in all of 2017, UNICEF says.

In Mali's Mopti region, which has become the epicentre of the conflict, reports of armed groups burning people alive in their homes, hacking people to death with machetes and dragging commuters out of public buses to be slaughtered are widespread.

The area has seen the closure of more than 600, or 30 percent, of its schools, leaving children such as Diagahate without access to formal education.

"He never used to be like this. He was so jovial," said Amadou Diagahate, the 13-year-old's grandfather. Sitting beside him, the boy appeared on the verge of tears as he stared down at his fidgeting hands. He could not muster a single word.

"We are not happy here. This is not our home," Amadou Diagahate said.

But by some measures, Diagahate is one of the lucky ones. Aid groups have provided shelter and food, and he is being cared for by his family.

Without the protection of a classroom, some children are at a higher risk of being recruited by armed groups.

"They join because they don't want to die of hunger. They join because if they don't, another group might kill them," said Yacouba Maiga, the head of Catholic Relief Services' Mopti office.

Young girls grind cornmeal on what was once was a school day in Mopti, Mali; their village was attacked and burned to the ground, so they now spend their days doing chores at a camp for displaced people [Annika Hammerschlag/Al Jazeera]

The situation is especially precarious for girls who, out of school, are more vulnerable to being forced into marriage.

A number of African countries including Mali have banned child marriage. But without an education many girls may never learn their rights, said Ghislaine Gatho, the head of the Mopti office for the UN Office for the Coordination of Humanitarian Affairs.

"People are exploiting the vulnerability of these kids," she said.

Girls who marry early are more likely to suffer from sexual abuse and early pregnancy, which can lead to fistulas, eclampsia and chronic infections.

Complications from pregnancy and childbirth are the primary causes of death for girls aged 15 to 19 worldwide, according to the World Health Organization. Babies born to adolescent mothers are more likely to be premature and suffer from serious conditions such as low birth weight.

International aid organisations and local education authorities are working to implement alternative education methods such as creating community learning centres and broadcasting lessons on the radio.

However, an overall lack of funding and attention from involved governments and the international community is limiting emergency efforts.

Before the violence started, Mali was a warm, welcoming place where even the poorest offered strangers food and water, said Catholic Relief Service's Maiga. Now, thousands of children, born into a period of conflict, are being raised in a culture of mistrust.

"People are being hunted and they don't know why. People are having to flee and they don't know why," he said.

"There are young people who know nothing other than this crisis."