* Workers evacuated as Iraqi forces battle to hold biggest refinery
* Washington considers air strike request, allies caution against
* Saudi Arabia, Iran comment, as war inflames regional rivalries
* Calls in United States for Maliki to go as a condition for help
Secretary of State John Kerry said President Barack Obama still had "all options" open to him but U.S. regional allies Turkey and Saudi Arabia echoed concern in Washington about the risk of U.S. action serving only to inflame the sectarian war.
The sprawling Baiji refinery, 200 km (130 miles) north of the capital near Tikrit, was a battlefield as troops loyal to the Shi'ite-led government held off insurgents from the Islamic State of Iraq and the Levant and its allies who had stormed the perimeter a day earlier, threatening national energy supplies.
A government spokesman said around noon (0900 GMT) that its forces were in "complete control" but a witness in Baiji said fighting was continuing and ISIL militants were still present.
A day after the government publicly appealed for U.S. air power, there were indications Washington is sceptical of whether that would be effective, given the risk of civilian deaths that could further enrage Iraq's once dominant Sunni minority.
Turkish Prime Minister Tayyip Erdogan, a NATO ally, said the United States "does not view such attacks positively", given the risk to civilians. A Saudi source said that Western powers agreed with Riyadh, the main Sunni state in the region, that what was needed was political change, not outside intervention, to heal sectarian division that has widened under Maliki.
Video aired by Al-Arabiya television showed smoke billowing from the plant and the black flag used by ISIL flying from a building. Workers who had been inside the complex, which spreads for miles close to the Tigris river, said Sunni militants seemed to hold most of the compound in early morning and that security forces were concentrated around the refinery's control room.
The 250-300 remaining staff were evacuated early on Thursday, one of those workers said by telephone. Military helicopters had attacked militant positions overnight, he added.
Baiji, 40 km (25 miles) north of Saddam Hussein's home city of Tikrit, lies squarely in territory captured in the past week by an array of armed Sunni groups, spearheaded by ISIL, which is seeking a new Islamic caliphate in Iraq and Syria. On Tuesday, staff shut down the plant, which makes much of the fuel Iraqis in the north need for both transport and generating electricity.
ISIL, which considers Iraq's Shi'ite Muslim majority as heretics in league with neighbouring, Shi'ite Iran, has led a Sunni charge across northern Iraq after capturing the major city of Mosul last week as Maliki's U.S.-armed forces collapsed.
The group's advance has only been slowed by a regrouped military, Shi'ite militias and other volunteers. But on Tuesday, Sunni fighters took the small town of Mutasim, south of Samarra, giving them the prospect of encircling the city which houses a major Shi'ite shrine. A local police source said security forces withdrew without a fight when dozens of vehicles carrying insurgents converged on Mutasim from three directions.
ISIL, whose leader broke with al Qaeda after accusing the global jihadist movement of being too cautious, has now secured cities and territory in Iraq and Syria, in effect putting it well on the path to establishing its own well-armed enclave that Western countries fear could become a centre for terrorism.
The Iraqi government made public on Wednesday its request for U.S. air strikes, two and half years after U.S. forces ended the nine-year occupation that began by toppling Saddam in 2003.
Asked whether Washington would accede to that appeal, Kerry told NBC only that "nothing is off the table".
Some politicians have urged Obama to insist that Maliki goes as a condition for further U.S. help. Asked about U.S. aid for the prime minister, Kerry said: "What the United States is doing is about Iraq, it's not about Maliki. Nothing the president decides to do is going to be focused specifically on Prime Minister Maliki. It is focused on the people of Iraq."
He played down the extent of possible U.S. cooperation with Iran, the main Shi'ite power, which backs Maliki, saying Washington wanted communication on Iraq with its long-time enemy to avoid "mistakes" but would not work closely with Tehran.
U.S. officials, speaking on condition of anonymity, say Iraq has asked for drone strikes and increased surveillance by U.S. drones, which have been flying over Iraq. However, officials note, targets for air strikes could be hard to distinguish from civilians among whom ISIL's men were operating.
Turkish premier Erdogan said: "America, with its current stance and the statements it has made, does not view such attacks positively ... Such an operation could result in a serious number of deaths among civilians."
The Saudi source told Reuters: "No outside interference will be of any benefit," adding that Washington, France and Britain all agreed with Riyadh that "dialogue and a political solution is the way forward in Iraq".
Competing with Iran for regional influence - a rivalry that echoes 13 centuries of Sunni-Shi'ite strife - Saudi Arabia hit back angrily at an accusation this week by Maliki's government that Riyadh was promoting sectarian "genocide" by supporting ISIL. Foreign Minister Saud al-Faisal called that "ludicrous" and said Saudis were fighting ISIL, an al Qaeda splinter group.
From Iran, which has pledged to intervene if necessary in Iraq to protect Shi'ite holy places, a tweet from an account linked to Supreme Leader Ayatollah Ali Khamenei noted that Western powers support the mostly Sunni revolt against Syria's Iranian-backed leader. It called for Sunnis and Shi'ites to resist efforts by the militants and the West to divide Muslims.
If the Baiji refinery falls, ISIL and its allies will have access to a large supply of fuel to add to the weaponry and economic resources seized in Mosul and across the north.
An oil ministry official said the loss of Baiji would cause shortages in the north, including the autonomous Kurdish area, but that the impact on Baghdad would be limited - at around 20 percent of supplies - since it was served by other refineries.
Some oil companies have pulled out foreign workers.
Washington and other Western capitals are trying to save Iraq as a united country by leaning hard on Maliki to reach out to Sunnis, many of whom feel excluded by the Shi'ite parties that have dominated elections since the Sunni Saddam was ousted.
In a televised address on Wednesday, Maliki appealed to tribes, a significant force in Sunni areas, to renounce "those who are killers and criminals who represent foreign agendas".
But so far Maliki's government has relied almost entirely on his fellow Shi'ites for support, with officials denouncing Sunni political leaders as traitors. Shi'ite militia - some of which have funding and backing from Iran - have mobilised to halt the Sunni advance, as Baghdad's million-strong army, built by the United States at a cost of $25 billion, crumbles.