KIRKUK, Iraq - Militants pressing a major offensive in Iraq attacked the country's biggest oil refinery on Wednesday, as the premier scrambled to regain the initiative by sacking security commanders and reaching out to political rivals.
The United States, which is mulling air strikes against the insurgents, said it believed Baghdad's security forces were rallying against the assault, while Iran pledged not to let Shiite shrines in Iraq fall to the Sunni Arab militants leading the charge.
Washington has nevertheless deployed some 275 military personnel to protect its embassy in Baghdad, the first time it has publicly bolstered the mission's security, while other countries have also sought to evacuate nationals and pull diplomats out.
The crisis, which has displaced hundreds of thousands of Iraqis, threatens to carve up the country while the assault on the Baiji oil refinery early Wednesday will likely further spook international oil markets.
From about 4:00am, clashes erupted at the Baiji refinery complex in Salaheddin province, north of Baghdad, according to a senior official and a refinery employee.
They said some tanks containing refined products caught fire and that the Iraqi security forces had suffered casualties.
Prime Minister Nuri al-Maliki's security spokesman, Lieutenant General Qassem Atta, later said that Iraqi forces had repelled the attack in fighting which left 40 militants dead. He did not mention security force casualties.
The refinery was shut down and most employees evacuated on Tuesday due to a drop in demand caused by the militant drive, which is being spearheaded by jihadists from the Islamic State of Iraq and the Levant (ISIL).
World oil producers have cautiously watched the unfolding chaos in Iraq, which currently exports around 2.5 million barrels of oil per day, but have stressed that the country's vast crude supplies are safe - for now.
Rebecca O'Keeffe, head of investment at stockbroker Interactive Investor said the attack on the Baiji refinery ought to have limited international impact.
"As I understand it, the Baiji refinery doesn't provide any supply outside of Iraq, so the impact of this attack is possibly less severe than feared," O'Keefe told AFP.
"However if the ISIL forces continue to make progress towards Baghdad and onto Iraq's main oilfields in the south, the current oil price stabilisation is likely to be short lived and we could see a significant spike in oil prices."