MAIDUGURI, Nigeria — 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, said 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. The seized villages are near Gwoza, a regional political center whose emir was killed in a Boko Haram ambush on his convoy last week. Emirs are religious and traditional rulers who have been targeted for speaking out against Boko Haram’s extremism.

Borno Gov. Kashim Shettima traveled on Saturday to Gwoza to pay his respects to the fallen emir and was quoted as saying it was a terrifying ride.

“If I say I was not petrified travelling through that … road to Gwoza I would be lying because that road had been designated a no-go area for about two months now due to the incessant attacks and killings that occur there,” the governor was quoted as saying by Information Nigeria, a website. A local journalist who was in the convoy that was escorted by 150 soldiers counted at least 16 towns and villages that were deserted along the 85-mile route, according to the local media report.

Shettima earlier told The Associated Press that he was having the accounts of Boko Haram seizing villages investigated and that he couldn’t confirm them.

Gavva said the Islamic rebels exert iron control over the villages seized in Borno, one of the three states under the state of emergency declared by President Goodluck Jonathan which cover about one-sixth of the country.

“They are in charge there. You cannot do anything on your own without their permission. Even if the villagers want to go and till their farmlands, they had to first contact them for permission,” said Gavva. The group doesn’t allow young men to leave their homes, he 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.