BAGHDAD : The Islamic State group on Monday returned to the desert town of Rutba in western Iraq, less than a day after vacating it, officials said.

The mayor of the remote town in Anbar province had warned when IS pulled out that the militant organisation may just be testing the population's allegiance.

"Daesh (IS) has re-established its control on the city of Rutba... which it had left the previous day," said a senior officer in the Jazeera Operations Command in charge of the area.

"Daesh came back from Al-Qaim with armoured vehicles and artillery," the officer said, speaking on condition of anonymity. "They deployed them on the outskirts of the town and at the main entrances, as if to defend it from any attack by the security forces," he said. "However, Daesh's foreign leaders previously based in Rutba did not return," he said.

Rutba lies about 390 kilometres (245 miles) west of Baghdad on the road to Jordan.

Imad Ahmed, the town's mayor, said "it was like a trick played by IS on the locals."

He had told AFP after IS's pullout on Sunday that the militant group may be trying to lure out members of the population secretly cooperating with the security forces.

Ahmed and Raja Barakat, the head of the Anbar provincial council's security committee, confirmed that the foreign IS fighters in Rutba had not returned.

Military officials had warned after the IS pullback on Sunday that the Iraqi security forces could not move in immediately to take over the town IS had abandoned.

Rutba is far from the government forces' main bases and any large-scale operation would require planning and the approval of the country's top military leadership.

Meanwhile, an American fighting for Islamic State was taken into custody in northern Iraq after emerging from territory controlled by the militant group in Syria, media reports said on Monday.

CBS News, citing two sources with the Kurdish peshmerga military force, said the American fighter was trying to return to Turkey. He was identified as Muhammad Jamal Amin, 27, of Virginia, it said, citing Kurdish news organizations.

The State Department said it was aware of the reports that a US citizen allegedly fighting for Islamic State was captured by Kurdish peshmerga forces in northern Iraq.

"We are in touch with Iraqi and Kurdish authorities to determine the veracity of these reports," a State Department official in Washington said on customary condition of anonymity.

CNN, which also reported the incident, said the fighter was captured near Sinjar and handed over to Kurdish authorities in the region.

Peshmerga forces initially fired warning shots when they saw the man on concerns he was a suicide bomber, but he identified himself as a former member of Islamic State who wanted to turn himself in, according to CBS.

Amin, whose father is from Palestine and mother from Iraq, had fought with the militants for a couple of months, it said, citing Kurdish reports.