BAGHDAD (REUTERS) - Iraqi forces said they fought off an overnight attack by Islamic State in Iraq and Syria (ISIS) militants near the city of Ramadi, which the insurgents overran at the weekend in the most significant setback for the government in a year.
Islamic State is seeking to consolidate its gains in the vast desert province of Anbar, of which Ramadi is capital, where only isolated pockets of territory remain under government control.
The ISIS advance has exposed the failings of Iraq's army and the limitations of US airstrikes.
Government forces backed by Shi'ite militias have meanwhile been building up at a base near Ramadi in preparation for a counterattack to retake the city, where Islamic State forces have tanks and artillery abandoned by fleeing Iraqi forces.
Overnight, Islamic State fighters attacked government forces in the town of Husaiba al-Sharqiya, about halfway between Ramadi and the Habbaniya military base where militia fighters have assembled, police and pro-government forces said.
"Daesh (ISIS) attacked us around midnight after a wave of mortar shelling on our positions," Amir al-Fahdawi, a leader of the pro-government Sunni tribal force in the area, told Reuters. "This time they came from another direction in an attempt to launch a surprise attack, but we were vigilant and, after around four hours of fighting, we aborted their offensive," he added.
The Habbaniya base is midway between Ramadi and the town of Fallujah, which has been under ISIS control for more than a year and is 50 km from the Iraqi capital.
ISIS appears to be trying to join up Ramadi and Fallujah by taking territory between the two towns. As pressure mounted for action to retake Ramadi, a local government official urged citizens to join the police and the army to join what Shi'ite militiamen have said will be the"Battle of Anbar".
Islamic State fighters have set up defensive positions and laid landmines, witnesses in Ramadi said. The group's black flags are flying over the main mosque and other public buildings.
The White House said a US-led air campaign would back Iraqi forces in their attempt to regain Ramadi, whose fall exposed the limits of US air power in its battle against the radical Sunni Islamic State in both Iraq and Syria.
The US is anxious that the Shi'ite militia are controlled by the Iraqi authorities rather than Iranian advisers. There are also fears in Washington and elsewhere that the fighting in Iraq will become a polarising clash between Shi'ites and Sunnis as Iraqi Prime Minister Haider al-Abadi becomes increasingly dependent on the Iranian-backed Shi'ite militias to step in where the Iraqi military has failed.
Abadi's decision to send in the militia, known as Hashid Shaabi or Popular Mobilisation, to try to retake the predominantly Sunni city of Ramadi could stir up further sectarian hostility in one of the most violent parts of Iraq.
Ramadi was Islamic State's biggest success since it captured the northern city of Mosul last year and declared itself an Islamic caliphate. While it has been forces to give ground in Tikrit, Saddam Hussein's home town, and in the Syrian city of Kobani, the group still controls large areas of Iraq and Syria.
Local officials have said 500 people were killed in the fighting to take Ramadi and the international migration agency says more than 40,000 people have fled the city.
While the Abadi government has renewed its pledge to equip and train pro-government Sunni tribes with a view to replicating the "surge" campaign of 2006-07, when U.S. Marines turned the tide against al Qaeda - forerunners of Islamic State - by arming and paying local tribes in a movement known as the Anbar Awakening.
But a repeat will be more difficult. Sunni tribal leaders complain that the government was not serious about arming them again, and say they received only token support. When the Iraqi forces beat a hasty retreat from Ramadi at the weekend, they left behind a large amount of military supplies, including about a half a dozen tanks, around 100 wheeled vehicles and some artillery, the Pentagon said.
A Pentagon spokesman said it would have been preferable if the Iraqi troops had destroyed the equipment before leaving.