In September 2014, Boko Haram fighters succeeded in seizing the commercial town of 300,000 inhabitants, before being driven out seven months later by the army following a heavy offensive.
Mostly destroyed, Bama became a ghost town deserted by its inhabitants.
But four years ago, life slowly resumed. Some 120,000 residents who had taken refuge in the Borno state capital of Maiduguri gradually resettled in Bama.
Today on one side, houses with new roofs welcome back former inhabitants, encouraged by official promises of peace.
On the other side, endless rows of tin shacks serve as a refuge for newcomers. Tens of thousands of displaced Nigerians have come out of the "bush," the countryside where jihadists still battle soldiers beyond Bama's trenches.
Inside the garrison enclave, dozens of destroyed houses, gutted roofs and charred walls are a painful reminder of Bama's recent history.
Halima Tarmi Abba returned to Bama in 2018, four years after fleeing.
"The authorities gave us a new house because ours had been completely destroyed," says the 36-year-old mother of three.
In all, the government has built and rehabilitated more than 10,000 houses, around 50 water pumps and 154 school classes, according to the U.N.
But for a year, Bama has been unable to absorb the flood of returnees.
"The city is overcrowded, because the authorities have closed the camps in Maiduguri, and a large number are returning to Bama," Abba says.
"There are too many children in the classrooms, and patients in the hospitals."
Since May 2021, Borno state authorities have closed more than nine camps, which housed 140,000 people, to push the displaced to resettle outside Maiduguri, in areas they claim to have secured, such as Bama.
The trenches that encircle Bama illustrate that if the military holds the northeastern cities, they do not control the countryside, where they are vulnerable to militants who have turned to ambushes and roadside explosives.
The 2021 death of Boko Haram chief Abubakar Shekau during infighting with rival fighters from the Islamic State West Africa Province (ISWAP) did not signal the end of a conflict that has killed more than 40,000 and displaced two million since 2009.
But it has allowed ISWAP to consolidate as the dominant jihadist force in the region, in particular in the Sambisa forest, not far from Bama.
Gunshots and explosions
"I'm happy to be living in Bama again, but we can't say that the conflict is behind us," Abba says.
"Sometimes we hear gunshots in the night, or even explosions, the jihadists are not far away."
Every day, "hundreds of people continue to arrive from villages still controlled by armed groups, exhausted with fatigue and hunger," explains Ousmane Umar, a Nigerian aid employee who has worked in Bama since 2018.
Since last summer, around 60,000 people have arrived in Bama: villagers who lived under Boko Haram, or families of its former combatants who have recently surrendered to the authorities.
Many find refuge in the camp for displaced people inside Bama, initially built for 25,000 people, but which the U.N. says hosts 88,000 now. There are plans to expand the camp as quickly as possible.
At its entrance, exhausted women and men drag themselves toward thousands of tin shacks; others sit impassive among hundreds of children playing noisily.
Ibrahim shares one of the huts — less than 10 square meters (108 square feet) — with 10 family members.
"It's not liveable, but where do you want us to go?" asks the father who arrived nine months ago.
More than 50,000 children in the camp share a single primary school. Sanitary facilities are largely insufficient.
"People are literally living on top of each other, it's a really desperate situation," said Trond Jensen, head of the U.N.'s Office for the Coordination of Humanitarian Affairs in Nigeria.
There was also the risk of a "disease outbreak," he added.