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.

For Iraq’s armed forces, and the Americans who are training and backing them, this is a particularly important fight. Here, the country’s Shiite militias are not taking part, and that gives the regular Iraqi military a chance to repair its image. The fall of Ramadi seven months ago struck a blow to the already tattered reputation of the security forces, and it highlighted flaws in the U.S. approach to supporting them.

“This had to be a battle using purely the Iraqi military, in order to return the prestige of the Iraqi army,” said Maj. Gen. Ismail al-Mahlawi, head of the Anbar Operations Command, as he watched U.S.-led coalition airstrikes send thick, gray clouds into the air above the city. “The army in the past has been an army of defeats, but now we will be the army of liberation.”

On Tuesday, Mahlawi’s soldiers retook control of the Anbar Operations Command compound, in northern Ramadi. For his men, who were once based here, it was a poignant win, and aside from the U.S.-led airstrikes, it was solely theirs, he said.

In the compound’s headquarters, Capt. Saad Asri stepped into his old office, which he fled as the city fell in May. A jumble of military files were scattered on the floor. In the main operations room, a map on the wall charted the positions of Iraqi forces before the city fell.

“There was panic,” Asri recalled of the day of the withdrawal. “It was a confused retreat.”

New military supplies had just been sent from Baghdad, and most fell into the hands of the militants as they launched a wave of suicide bombings on the city's defenses. Asri hopes that this time around, with increased air support from the U.S.-led coalition, Iraqi army forces will be able to do a better job of holding ground.

The mangled bodies of Islamic State fighters still lay last week on the tree-lined roads in the military compound, sprawled across the blacktop after being hit from the air. Although the main building was largely intact, others near it were pancaked by airstrikes. Deep craters pitted the ground. The leaves on the trees were gray with layers of dust.

Airstrikes played a large part in the advance here, soldiers said, raising questions about the army’s capability to push farther, particularly in areas with a high concentration of civilians, where air support is more complicated.

“Eighty percent of the battle finished from the air,” Asri said, pointing out a body crushed under a nearby palm tree.“We received only a little resistance. The airstrikes had the major role.”

But to the southwest, Iraqi special forces, known as the Golden Division, have seen more close combat, seizing control of the sprawling Tamim neighborhood last week. Having trained closely with the U.S. military, the division is considered the country’s most elite fighting force.

“These neighborhoods we know street by street, we know the houses,” said Lt. Gen. Abdul Ghani al-Asadi, head of Iraq’s special forces, as he spread out a map of the city at his office in Baghdad. There are about 600 fighters from the Golden Division involved in the operation, he said.

“In all our other operations, the Hashd have been with us,” he said, referring to the largely Shiite militiamen known in Iraq as the Hashd al-Shaabi, or popular mobilization units. “In Baiji and Tikrit, they have proved their qualifications, because they fought with faith. But this is our fight. In Ramadi, there is not one single fighter from the Hashd.”

The Shiite militias have generally used overwhelming manpower to push back Islamic State fighters. About 20,000 popular mobilization fighters have been injured or killed since the summer of 2014, Abu Alaa al-Walaie, secretary general of the Kitaeb Sayyid al-Shuhada militia, said in an interview on Iraqi television this month.

The Iraqi government and U.S. officials had raised concerns about Shiite militia forces being allowed to participate in the offensive here in a largely Sunni province. Instead, they stressed the need for local Sunni fighters to take part alongside Iraqi forces.

The participation of those forces so far has been limited; they are stationed at checkpoints and defensive positions behind the front lines.

“We need them just as a symbol that the people of Anbar participated,” Mahlawi said, though he added that they will be used to hold ground as the city is regained.

At a position held by Sunni fighters a few miles outside the city, Capt. Mohammed al-
Mohammed, a 28-year-old from Ramadi, said Sunni fighters are frustrated, keen to participate in taking back their homes.

“I measured the distance to my house. It’s only five kilometers,” he said, about three miles. “At night, I go up to the hill, and I can see the lights on my streets.”

Asadi estimated that there are still about 1,000 Islamic State militants in the city, while U.S. officials have suggested that with 350 killed in the latest assault, they could number between 250 and 650.

In a briefing last week, Col. Steve Warren, a U.S. military spokesman in Baghdad, cautioned that in an urban environment, a relatively small force of fighters could hold back a larger army “for some time.”

“It's a slow process. It’s a deliberate process,” he said. “Urban fighting is tough. It’s hot, it’s scary, and it can be deadly.”

Estimates on just how many civilians remain in the city also vary widely.

Mahlawi says about 150 families are still inside. Other Iraqi security officials put that number much higher — at about 10,000 people.

Iraqi planes have dropped leaflets urging families to leave the city, but many cannot. After a leaflet drop last week, one family on Ramadi’s 20th Street raised a white flag outside their home. But all were executed by Islamic State militants soon after as an example to others, Asadi said — men, women and children were killed. Security forces are in regular phone contact with some of the families left inside the city, he said. “Whoever tries to escape, they execute them,” he said. “What’s delaying us is the civilians.”

U.S. Defense Secretary Ashton B. Carter said this month that the United States is ready to provide Apache helicopters to end the fight. The close air support would enable more targeted strikes with lighter weapons, reducing civilian casualties, Iraqi commanders say. But with helicopters susceptible to being shot down by rocket-
propelled grenades, Lt. Gen. Hamid al-Maliki, the head of Iraq’s Army Aviation Command, said there were currently no plans to use them in the city itself.

“It’s too dangerous,” he said.

All of the city’s eight bridges have been destroyed, leaving militants surrounded by rivers on three sides. On the fourth flank, to the east, Iraqi forces are closing in, but it could be a week before a final push for the city is made, Asadi said. Military engineers have arrived to make a temporary bridge.

“They are trapped; they have no way to get ammunition,” Asadi said of the Islamic State fighters. “It’s only a matter of time.”

But the militants have dug underground tunnels, stockpiled car bombs and laced roads with explosives.

“Go and fight,” the Islamic State leader’s voice extolled his men over the walkie-talkie. “Either you will have victory, or you will be a martyr in heaven. Fight them, fight them, fight them.”

Mustafa Salim in Ramadi contributed to this report.