Islamic State (IS) forces have taken an Iraqi town about 8km from an US air base where hundreds of troops are stationed, according to the Pentagon.

However, US officials have downplayed the significance of the fall of the town of al-Baghdadi, which is within striking distance of the Ain al-Asad air base.

Ain al-Asad was attacked by IS forces on Friday though the militants were repelled by Iraqi troops, officials say.

Al-Baghdadi had been one of the few towns in the western Anbar province still held by the Iraqi army.

The fall of Al-Baghdadi is likely to prompt a reopening of the debate in Washington about whether deploying US ground forces against IS can be avoided.

On Friday about 25 IS fighters attacked the Ain al-Asad air base but were repulsed by Iraqi security forces guarding the perimeter who killed most of the assailants, the Pentagon said.

Rear Admiral John Kirby, the Pentagon press secretary, told reporters in Washington that US Marines training Iraqi military troops at the sprawling base were about 3.5kms away and were not involved in the fight.

US forces scrambled drones and Apache helicopters to assist but the fighting was over by the time they arrived and they never fired a shot, said Army Colonel Steve Warren, a Pentagon spokesman.

Rear Admiral Kirby said the latest information from Iraq indicated the attack was carried out up to 25 Islamic State fighters and was led by several suicide bombers, some of whom detonated their vests.

The battle took place at the perimeter of the base and it was not immediately clear whether the attackers were able to penetrate into the facility.

Rear Admiral Kirby cautioned that the information was preliminary and some details could change as Iraqi officials get a better understanding of how the attack unfolded.

“It does appear now that most, if not all of them, were wearing Iraqi uniforms,” Rear Admiral Kirby said of the attackers.

Militants from the jihadist group had attacked the Ain al-Asad base and the nearby town of al-Baghdadi a day earlier, leading to sporadic clashes in the town overnight.

Rear Admiral Kirby said US assessments indicated Islamic State fighters were in control of al-Baghdadi.

Al-Baghdadi has been besieged for months by Islamic State, which captured swathes of northern and western Iraq last year, prompting a campaign of US-led air strikes and the deployment of hundreds of US military advisers to the country.

About 320 US Marines are training members of the Iraqi 7th Division at the base, which has been struck by mortar fire on at least one previous occasion since December.

The US military said the United States and its coalition partners conducted seven air strikes against Islamic State militants in Iraq between early Thursday and early Friday, including five strikes in the vicinity of Ain al-Asad base.

Reuters