Iraq's biggest oil refinery has shut down and its foreign staff have been evacuated, refinery officials told Reuters.

Local staff remain at the refinery and the military is still in control of the facility near in the town of Baiji, the officials said.

Militants from Isis (Islamic State of Iraq and the Levant) took control of Iraq's second city Mosul last week and rapidly advanced on a number of northern towns after security forces aligned with the central government had fled.

Heading a coalition of Sunni militants, Isis have taken control of Tikrit and Tal Afar, while battling with loyalist forces in the towns of Samarra and Baquba close to the capital Baghdad.

The Baiji refinery had been surrounded by Sunni extremists in recent days, after Isis earlier took control of most of the town.

The Baiji refinery can produce up to 300,000 barrels of oil per day and supplies domestic consumption, including the Iraqi capital Baghdad.

Its closure could potentially lead to exporters re-routing some oil for domestic consumption, in a bid to make up for the shortfall.

Iraq was producing around 3.5m barrels of oil per day before the Isis crisis, 2.8m of which were exported. Production and exports from oil facilities in the south of the country have not been affected by the Isis advance through northern Iraq.