When Islamic State gunmen stormed the northeast Nigerian town of Magumeri on the night of August 21, they had free rein.
Nigerian soldiers had left the town earlier that month under a new strategy of withdrawing to "super camps" that can be more easily defended against insurgents the army has been struggling to contain for a decade.
Unchallenged, the Islamist militants torched a clinic in Magumeri, ransacked government buildings and looted shops before returning to another town they had raided that night called Gubio, residents said.
The new military strategy announced by President Muhammadu Buhari in July to concentrate soldiers in big bases is designed to give troops a secure platform from which they can respond quickly to threats in the region and raid militant camps.
People familiar with the military's thinking and security officials, however, say the new tactic for fighting Islamic State's West Africa branch and Boko Haram is mainly an attempt to stem casualties.
The military did not respond to requests for more details about its strategy or the impact it will have on the region.
"We strongly believe the days of BH (Boko Haram) moving freely and passing in between static defensive locations are over," Major General Olusegun Adeniyi, who commands the anti-insurgency operation, told reporters last month.
Boko Haram launched an insurgency in 2009 to overthrow the government and establish an Islamic caliphate. The group, whose unofficial name means "Western education is forbidden," held territory the size of Belgium in 2014 but a multinational offensive recaptured much of it the following year.
The group split in 2016 and the faction that has been the greater threat ever since won the recognition of Islamic State.
The decade of war has killed more than 30,000 civilians and spawned what the United Nations calls one of the world's worst humanitarian crises, which foreign nations are trying to contain with billions of dollars of aid.
But the crisis shows no sign of abating.
'IT'S A MESS'
The army's withdrawal into large bases has coincided with a string of insurgent raids on newly unprotected towns and has left the militants free to set up checkpoints on roads as they roam more freely across the countryside, according to three briefing notes from an international aid and development organization, two security officials and residents.
That has left thousands of civilians without access to aid, according to the briefing notes seen by Reuters.
Soldiers are no longer protecting some key roads, cutting off access for humanitarians workers as more of the region falls under the sway of the insurgents, aid and security sources said.
"It's a mess, militarily, and a disaster for humanitarian actors," one foreign security official said.
The population of towns being abandoned by the military is a combined 223,000 people, according to one of the aid agency briefing notes.
The military departures so far have cut off more than 100,000 people from aid and if more soldiers go, as many as 121,000 other civilians could flee their towns, one aid agency briefing note said.
"The impact will be one of continued skirmishes - soldiers under constant strain to deal with the insurgency where Islamic State and Boko Haram dictate the momentum," said Jasmine Opperman, a terrorism expert based in South Africa.
It's not yet clear how many "super camps" the army plans to set up, where they will be nor how many soldiers each will hold.
'HERE TO PROTECT YOU'
The new strategy follows a series of setbacks for the army which has failed to keep a tight grip on territory it has clawed back since 2015. Last year, insurgents repeatedly overran smaller bases and sent soldiers and tens of thousands of people fleeing from larger towns.
Security experts put the military death toll since June 2018 at anywhere from hundreds of soldiers to in excess of 1,000.
The military has not released casualty figures but denies that many soldiers have been killed.
One security adviser at an international aid organization said a major goal of the new large bases was damage control, rather than going on the offensive.
"It is to consolidate all of the strength in one place to prevent them being overrun every week," the adviser said.
He said the areas vacated were being filled by insurgents and that would make it harder for the military to re-enter, leaving civilians vulnerable.
Those concerns were echoed by the governor of Borno - the birthplace of Boko Haram and the state worst hit by the insurgency. Governor Babagana Umara Zulum told reporters last month that recent attacks were the result of a "serious vacuum" following the withdrawal of soldiers.
Islamic State is also using its newfound freedom to woo locals. Drained by the decade-long conflict, some are open to moving into areas controlled by the insurgents where life can be more stable, residents said.
Before hitting Magumeri last month, the militants had passed through the town of Gubio, some 40 km (25 miles) to the north.
There, an Islamic State fighter led evening prayers followed by a sermon, according to six residents.
"We are here to protect you, not to harm any one of you," the IS fighter told residents. "Those with uniforms are your enemies, and we are here to deal with them and their supporters. You should feel free."Rather than flee to a government-controlled city such as Borno state's capital Maiduguri, many Gubio residents stayed.