Then, soldiers bring the bodies to the hospital and dump them at the morgue, officials and workers say. The flood is so consistent that the small morgue at the edge of the hospital grounds often has no room, with corpses flung by the military in the sand around it. Residents say they sometimes have to flee the neighborhood because of the fierce smell of rotting flesh.

From the outset of the battle between Boko Haram and the military, a dirty war on both sides that has cost nearly 4,000 lives since erupting in this city in 2009, security forces have been accused of extrajudicial killings and broad, often indiscriminate roundups of suspects and sympathizers in residential areas.

The military’s harsh tactics, which it flatly denies, have reduced militant attacks in this insurgent stronghold, but at huge cost and with likely repercussions, officials and rights advocates contend.

No one doubts that Boko Haram, which has claimed responsibility for assassinations and bombings that have killed officials and civilians alike, is thoroughly enmeshed in the local populace, making the job of extricating the group extremely difficult. But as with other abuses, the bodies piling up at the morgue — where it is often impossible to distinguish combatants from the innocent — have turned many residents against the military, driving some toward the insurgency, officials say.

Even the state’s governor, who acknowledged that he must tread a careful line not to offend the Nigerian military, expressed disquiet at the tactics. “A lot of lives are lost on a daily basis due to the inhumane conditions” at the barracks, known as Giwa, said the governor, Kashim Shettima. “They do deposit bodies on a daily basis.”