Boko Haram was founded in Maiduguri by a charismatic preacher who advocated a fundamentalist interpretation of the Koran and denounced Western influence in Nigeria.

Rampant poverty, high unemployment and government corruption attracted increasing numbers of followers even before the group turned to violence.

With those factors drivers for radicalisation, officials fear the city will remain a fertile breeding ground for extremism if the masses of orphans aren't taken care of.

Yet today they face the dilemma of how to get thousands of homeless children back to school in a desperately poor region where education has never been prioritised but is the key to preventing another jihadist uprising.

"We have an official number of over 52,000 orphans in Borno state," governor Kashim Shettima told AFP.

"Unofficially, the orphans may number over 100,000. Half of them may be in Maiduguri. Without educating these youth, they will be monsters that consume all of us.

"It's a very huge challenge."

The destruction of schools, the di.placement and loss of school years, and the abduction of school children has reduced the level of access to education in a safe environment,

Oge Chukwudozie, manager of Plan International Nigeria

Even as the Nigerian army reclaims the last of the territory held by Boko Haram, whose name roughly translated from Hausa means "Western education is sin", their relentless assault on education continues to restrict development.

In some of the far-flung camps on the border of Niger and Cameroon, where the battle is still raging, there are no schools at all.

In Maiduguri, whose population has doubled to over two million due to those seeking shelter from the conflict, thousands of children are slipping through the cracks.

"A lot of children have never been to school," said UNICEF child protection specialist Samuel Manyok

"It's as bad as (the situation in) Somalia and South Sudan combined."

Getting children whose lives have been shattered by Boko Haram into class is just one hurdle to reintegrating them back into society when many have suffered traumatising experiences.

Sitting at a concrete table in the amusement park, 15-year-old Aisha - not her real name - says she was the only one of her family to survive when Boko Haram invaded her village in 2015.

Millions of children across the world miss out on school as a result of humanitarian emergencies including conflicts, natural disasters and health crises. Education can be lifesaving - not being in school in emergencies can leave children at risk of child labour, early marriage, exploitation and recruitment into child labour.

It is also counting on the generosity and courage of international donors.

"The destruction of schools, the displacement and loss of school years, and the abduction of school children has reduced the level of access to education in a safe environment," said Oge Chukwudozie, manager of humanitarian organisation Plan International Nigeria.

"Given that the crisis directly targeted schools, non-government organisations had to play it safe so that children will not be exposed to direct attack by Boko Haram."

Nigeria's government is unlikely to resolve the school shortage quickly. But without urgent intervention, the risk of renewed violence increases.

"They need a second chance at life," said UNICEF's Manyok.

"Otherwise they become a destabilising factor. It's just a time bomb."