QAIM, Iraq (AP) — More than a year after the Iraqi town of Qaim was freed from the Islamic State group, booms from airstrikes still echo and columns of smoke rise beyond the berms and concrete walls marking the border with Syria. There, on the other side, the fight is raging to capture one of the militants' last enclaves.

Iraqi troops and Shiite militiamen outside Qaim watch over a giant earth barricade topped with barbed wire that runs along the long, featureless desert border, trying to prevent IS infiltration. Iraqi artillery and U.S.-led coalition warplanes bombard IS positions inside Syria, while Iraqi militiamen along with allied Iranian troops cross the border to back Syrian government forces there.

The battle on the doorstep means life in Qaim is still on hold, with residents waiting for their town to be rebuilt. There is still no central electricity, and running water works only intermittently. On the outskirts lie the wreckage of houses, their walls blasted open and roofs collapsed from bombardment during the assault a year ago by militias and U.S.-backed Iraqi troops who retook Qaim from IS.

The dusty, quiet streets are dotted with security checkpoints, manned by the military and the government-sanctioned, Iranian-backed militias known as the Popular Mobilization Forces, who are viewed with deep suspicion by many in this Sunni Muslim town. Many checkpoints fly both Iraqi national flags and the militias' banners proclaiming Shiite slogans.

On the main commercial road, militiamen and Iranian fighters shop in the markets. One fruit seller, Nabil Mashhad, said that since he doesn't speak Farsi, he shows the Iranians the prices on his cellphone's calculator.

"The situation is bad," Mashhad said. "Where are the services? The schools? There's no life. We're working just trying to get by."

The fight next door underscores the tenacity of the Islamic State group, a year after it was driven out of almost all the territory it once held, which at its height encompassed nearly a third of both Iraq and Syria.

The IS enclave across the border is the last area with a significant population that it holds, a 30-kilometer (20-mile) stretch of towns on the east bank of the Euphrates River.

The militants are surrounded. On one side are the Kurdish-led Syrian Democratic Forces, backed by American warplanes, who have been waging an offensive since mid-September. On the west bank of the river is the Syrian military, backed by Russian airpower along with Iranian troops and Iraqi militiamen.

IS has fought back ferociously. Last month, it attacked under cover of a sandstorm and captured a number of villages from the SDF. During the fighting, the militants drove explosives-packed cars through tunnels to emerge at their opponent's lines and at one point lured SDF fighters into an ambush by sending a woman to cry for help, according to the Syrian Observatory for Human Rights, a group that monitors Syria's war.

The extremist group is estimated to have several thousand fighters, including many Iraqis, in the enclave. The Iraqi military believes senior IS leadership are among them, possibly top leader Abu Bakr al-Baghdadi. IS holds one other pocket in Syria, but that is a largely uninhabited desert expanse surrounded by government-held territory.

"We never thought or said this fight would be easy. These are some of ISIS's most determined fighters, and they've had a lot of time to prepare," the deputy commander of the U.S.-led coalition, British Maj. Gen. Christopher Ghika, told The Associated Press.

Retaking the enclave has also been slowed by the rivalries among the various forces besieging it, said Iraqi Gen. Qassim Mohamed, commander of Iraqi forces in the Qaim area. Each must move carefully to avoid friction with the other.

Meanwhile, IS has turned to insurgent tactics inside Iraq. Last week, it claimed an attack on the home of a tribal leader that killed nine members of the security forces in Anbar, the province that includes Qaim. There has been an uptick in bombings and kidnappings elsewhere in the country, though not all are claimed by IS.

A reminder of the group's presence came last week when the U.S. military announced that American and Iraqi forces killed more than 50 militants in October in the Makhmour Mountains of north-central Iraq.

"The security situation is under control," Prime Minister Adel Abdul-Mahdi told a televised press conference. "It's natural that Daesh is trying to recover its strength," he said, using an Arabic acronym for the group. "Our forces monitor them, repel them and are in control of all the crossings."

In Qaim, the border crossing is sealed by a concrete wall with a metal gate. Militiamen cross into Syria using a gap in the earth berm south of the town.

The town was once a thriving stopover on the highway between Damascus and Baghdad. Long before a hard border materialized in the latter half of the 20th century, tribes sent their grooms and brides across the frontier to marry, extending the branches of their families on both sides.

When IS overran the town in 2014, it linked the group's holdings in both countries and connected them to key highways leading to multiple parts of Iraq.

Many of Qaim's 120,000 residents fled IS. A third of them still have not returned.

Security forces issue passes to allow residents to move in and out, a measure against infiltrators. But to apply for an ID, residents must be vetted by both the army and the militias, raising uncomfortable questions about who is in control.

Among Iraq's Sunnis, the Shiite militias are widely resented, and relations between the two communities have been poisoned ever since the 2003 U.S.-led invasion.

Qaim resident Talal Obeid said he had been hesitant about returning home because of reports of militia abuses.

"We are more scared of the yellow flags than the black ones," he said, referring to the yellow banners of the Kataeb Hezbollah militia and the black flags of IS.

"I worry if they stay, there will be friction and provocations."

___

Issa reported from Baghdad.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.