Boko Haram has now captured or sacked many of the small towns in Maiduguri’s orbit, and appears to be encircling the city of several million, whose population has swelled with thousands of refugees. It did much the same thing last summer, but confounded expectations by refraining from making a move on the city, northeastern Nigeria’s regional hub.

It is not clear whether the group will do so now. Nor is it known what dominion it exercises over the villages and small towns its fighters have attacked. The governor of Borno State, of which Maiduguri is the bustling capital, said the Islamists have imposed the crudest form of Shariah, or Islamic law, on these places.

The governor, Kashim Shettima, is among those who expect Boko Haram to continue to pressure Maiduguri. “The Boko Haram strategy is to strangulate the city, and make it the capital of their caliphate,” he said in an interview from the Nigerian capital, Abuja. “They have captured all the outlying towns. The Boko Haram is better armed than ever before.”

The group’s easy defeat of the Nigerian soldiers at Baga last week would seem to support the governor’s point.

A survivor of the attack, Hauwa’u Bukar, said the assailants were methodical and vicious. “When they neutralized the soldiers, they proceeded to Baga and started killing everyone on sight,” said Ms. Bukar, whose husband died in the attack. “There was no pity in their eyes. Even old men and children were killed.”