Fighters belonging to the Islamic State of Iraq and the Levant (ISIL) group have taken control of large parts of the western Iraqi town of al-Baghdadi, officials say, threatening an airbase where US soldiers are training Iraqi troops.

Al-Baghdadi, about 85km northwest of Ramadi in Anbar province, has been besieged for months by the group, which captured large expanses of northern and western Iraq last year.

ISIL attacked al-Baghdadi from two directions on Thursday and then advanced on the town, intelligence sources and officials in the Jazeera and Badiya operations commands said.

The officials said another group of fighters then attacked the heavily guarded Ain al-Asad airbase, 5km southwest of al-Baghdadi, but were unable to break into it, Reuters news agency reported.

Most of the surrounding towns in Anbar fell under ISIL control after the group advanced quickly across the Syrian border last summer.

Al Jazeera's Imran Khan, reporting from Baghdad on Friday, said: "We've seen this tactic by ISIL time and time again. Every time they want to attack an Iraqi army base - this would be the first coalition base - they first take the towns surrounding it.

"ISIL know the area very well and this will be a considerable challenge for the Americans, although they will be aided by their ability to call in air strikes quickly."

'Heavy fighting'

About 320 US soldiers from the Marines Corps 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.

Navy Commander Elissa Smith, a Pentagon spokesperson, confirmed there was "heavy fighting" in al-Baghdadi.

 Kurds press offensive against ISIL

She said there had been no direct attack on the airbase, but said: "There were reports of ineffective indirect fire in the vicinity of the base."

Naji Arak, the district manager, confirmed that ISIL fighters had entered al-Baghdadi and attacked some government buildings.

He initially estimated the fighters had taken 90 percent of the town but later said he could not confirm the extent of ISIL's control as intermittent clashes continued into the early morning.

The death toll from the fighting was not immediately clear.

Speaking to Al Jazeera, Montieth Stewart, a security analyst and former US colonel, said as ISIL advances, the US soldiers may be thinking more about fighting than training.  

"The mandate is to live. The first priority is to live to fight another day," he said.

The US is pinning its hopes on Iraqi government plans to build up a militia among the Sunni tribes in the area to fight ISIL.

Elsewhere in Iraq on Friday, five civilians were killed when bombs went off in two towns south of Baghdad, police and medical sources said.

Source: Al Jazeera and agencies