BAGHDAD — Fighters from the Islamic State were mustering with tanks, armored vehicles and heavy weapons on Wednesday near a strategically located rural town about 25 miles west of Baghdad in the embattled province of Anbar, local officials said.

The militants were approaching the town from three directions — north, west and east — through surrounding farmland, and they appeared to be preparing a siege, the officials said.

“The situation is dangerous here,” said Sheikh Faisal al-Esawi, the director of the town, Amariyat al-Falluja, and a leader of the Albu Esa tribe. By nightfall, no shots had been fired, but the situation remained very tense, officials said.

The Sunni militant group Islamic State, also known by the acronyms ISIS or ISIL, has been on the offensive throughout Anbar Province in recent weeks. It has scored a series of tactical victories and bedeviled the Iraqi security forces and their coalition partners, who have had limited success in reversing the militants’ gains.