The Islamic State group seized the town of al-Baghdadi in western Iraq's Anbar province on Friday, closing in on a nearby U.S. military base that is now the only bulwark between them and the capital, Baghdad. The extremists have been moving fighters from their home base in Syria into Anbar for the past few weeks, gearing up for a battle to consolidate their territory. 

The group also known as ISIS launched an attack on the town Thursday night, just 3 miles (5 km) from the Ain al-Asad U.S. Marine Corps base, where roughly 320 Americans are stationed to train Iraqi soldiers. Friday morning, eight would-be suicide bombers were able to infiltrate the base but did not manage to get close to U.S. troops before being killed by Iraqi security forces, according to CBS News.

Militants reportedly attacked al-Baghdadi from all sides during a sandstorm and managed to seize the police station and several government buildings. Internet and phone connection have been cut in the town, according to Radio Free Iraq, a U.S.-backed channel.

"Ninety percent of al-Baghdadi district has fallen under the control of the insurgents," district manager Naji Arak told Reuters.

ISIS has been known to plan large-scale attacks in Iraq during bad weather, hoping to catch Iraqi forces and pro-government militias unprepared.

This week, suspected ISIS militants detonated two car bombs and an improvised bomb just south of Baghdad, killing at least seven people and wounding dozens of others, according to the Institute for the Study of War. Iraqi security forces reportedly killed Ala Abu Haidar, the ISIS leader “responsible for suicide attacks in Baghdad,” on Tuesday.

Baghdad has been experiencing a surge in attacks since September as ISIS makes territorial gains in Anbar, hoping to weaken the capital before attempting to seize it. In October, the militants secured a supply route from their stronghold in eastern Syria’s Deir el-Zour province to al-Qaim, a town in western Anbar, and began using it to bring weapons and fighters to Iraq.

Anbar is a largely Sunni province, where the cooperation of Sunni tribes with Iraq’s Shiite-dominated security forces is essential to beating ISIS in Iraq. Last week, an Anbar official told Iraqi media that the U.S. had agreed to support security forces in the province. A source close to the Sunni militias recently told International Business Times that the Anbar forces were “being systematically armed” by the U.S.

Last week, officials lifted the nighttime curfew that had been in effect in Baghdad for the first time in a decade.