KANO, Nigeria — In an imam’s quiet office, two young men in long hooded robes, their faces hidden by checked scarves, calmly described their deadly war against the Nigerian state.

The office door was open. Children from the Koranic school adjoining the mosque streamed past, laughing and jostling. Worshipers from the evening prayer service, which the young men had just left, poured into the parking lot. If the police had been alerted in any way, the two young men would have been instantly arrested, or worse. But neither appeared nervous about possible betrayal.

“It is not the people of Nigeria, it is only the army and the police who are against us,” said one of the men, explaining their membership in Boko Haram, the militant group that has claimed responsibility for killing hundreds in its battle against the Nigerian government. “Millions of people in Kano State are supporting us.”

His bravado notwithstanding, the violent Islamist army operating out of these dusty alleyways, ready to lash out and quickly fade back, is deeply enmeshed in the fabric of life in this sprawling metropolis, succored by an uneasy mix of fear and sympathy among the millions of impoverished people here.