Boko Haram militants are taking over villages in northeastern Nigeria, killing and terrorizing civilians and political leaders, witnesses say, as the Islamic fighters make a comeback from a year-long military offensive aimed at crushing them.

Nigeria’s military has insisted that the big influx of troops and a year-old state of emergency in three states, which gives them the power to detain suspects, take over buildings and lock down any area, has the extremists on the run.

But while Boko Haram has in large part been pushed out of cities in the northeast, they have been seizing villages with thatched-roof huts in the semi-arid region where they once held sway, boldly staking their claim by hoisting their black flags with white Arabic lettering, and making large swaths of Nigeria no-go regions for the military.

Nglamuda Ibrahim, a local government official, says the militants hoisted their flags in Ashigashiya, which borders Cameroon, several weeks ago without interference from the security forces.

Muhammed Gavva, a member of one of the vigilante groups formed last year, named another dozen villages that also fell to Boko Haram, also close to the Cameroonian border, with no action taken by Nigerian security forces. He said one road to Maiduguri, the capital of Borno state where the military joint task force has its headquarters, is so dangerous that even soldiers don’t dare to travel it.

“We have long informed the military officials about this. They are aware but we don’t know what they are doing about that,” Gavva said.

Civilians frustrated by the military’s apparent inability to combat Boko Haram have formed vigilante groups like Gavva’s. They detain Boko Haram suspects and hand them over to the authorities. The move was supported and encouraged by the authorities. Hundreds of detainees have died in military custody, Amnesty International found in its investigations.

Since May, the extremists have waged a two-pronged offensive, widening their theater of operation beyond their home bases in the northeast with bombings in three cities that killed about 250 people while also carrying out near daily attacks on northeast villages, killing 20 people one day, 50 another.

On April 15, they grabbed the world’s attention when they kidnapped more than 300 girls from a school from the town of Chibok, in Borno. Chibok community leader Pogu Bitrus says 57 girls escaped by themselves, leaving an estimated 272 still held captive.

Boko Haram started off as a moderate religious sect nicknamed after the shouted refrain of its leader — “Western education is sinful” — who preached that Western influences have corrupted Nigerian society and caused corruption that impoverishes people in the biggest oil-producing country in Africa.

Boko Haram seeks to impose Shariah, or Islamic law, on Africa’s most populous nation of about 170 million people, which is almost evenly divided between the Muslim north and the Christian south.