In a small army camp on the northern edge of Ramadi, a group of Iraqi soldiers listened in on a walkie-talkie, eavesdropping on an Islamic State leader as he attempted to rally his men.

“Right now, we are suffering, but it is a test from God,” the militant’s voice crackled over the air, betraying an Egyptian accent. “Stay on this road. This is the road of honor and dignity.”

Intercepted Islamic State communications have become increasingly desperate in recent weeks, soldiers say, as the Iraqi army has gained momentum in the fight for this city 70 miles west of Baghdad. Buoyed by advances over the past week, Iraqi commanders say they expect to regain all of Ramadi by the end of the year. […]