Iraqi security forces have advanced further into towns north of Baghdad in a new offensive to retake the country's biggest oil refinery from Islamic State of Iraq and the Levant (ISIL) fighters.

Battles have been raging for the past two weeks between government troops and ISIL near both the city of Beiji, the command centre for the group, and the Beiji oil refinery, located about 200km from the capital.

The army has this week taken over the towns of al-Hajaj and Toumaa as it inches closer to Beiji.

"Now we’re in sweep mode, and holding the ground in these areas - so far we have gained control over these territories and expelled ISIL fighters from them," Saif Jabber, an army commander, told Al Jazeera.

While ISIL fighters remain in full control of Beiji city, the Iraqi army controls parts of the complex housing the oil refinery.

Al Jazeera’s Imran Khan, reporting from Baghdad, said that while the street-to-street fighting looks chaotic, the army has a plan.

"[The strategy is to] secure the main road, fan out into the nearby towns and villages and then push forward using Special Forces or militias, while the regular Iraqi army follows behind to secure the town," Khan said. "Then, they begin the next offensive."

ISIL fighters seized Beiji and surrounded the sprawling refinery in June during a swift campaign through northern Iraq.

The group also controls a large swathe of territory in neighbouring Syria and has proclaimed a caliphate straddling both countries.

The Beiji plant was producing about 175,000 barrels per day before it was closed, according to Iraqi officials. This amounted to almost a third of Iraq’s domestic daily consumption.

The facility’s closure had severe effects on the northern towns and cities that depended on it for their energy needs.