President Barack Obama pledged to take "precise" military action if needed to check marauding Sunni radicals in Iraq and offered up to 300 US advisors to train Iraqi forces facing a crisis splintering the country on sectarian lines.
But Obama, who based an entire political career on ending US involvement in Iraq, insisted the United States is not slipping back into the morass -- and issued a sharp warning that sectarianism spells disaster for Iraqi Prime Minister Nuri al-Maliki and Iran.
Obama signalled stepped up White House action after meeting top national security advisors to discuss how to respond to swift gains by rebel Islamic State of Iraq and the Levant (ISIL) forces, which have seized several key cities and threatening to advance on Baghdad.
The fighters have northern Iraq's biggest city, Mosul and taken swathes of territory in an advance which has displaced hundreds of thousands of people, left an unknown number dead and alarmed Western nations who fear the establishment of a vast new "terror" haven.
Obama was adamant, however, that "American forces will not be returning to combat in Iraq."
"But we will help Iraqis as they take the fight to terrorists who threaten the Iraqi people, the region and American interests as well," he said.
Obama said he had already bolstered surveillance and intelligence capabilities in the country, to assess the possibilities for military operations that might be in the US national interest.
"Going forward, we will be prepared to take targeted and precise military action if and when we determine that the situation on the ground requires it," said Obama.
Washington has already positioned an aircraft carrier in the Gulf and is also considering the possibility of drone strikes against ISIL forces.
Senior US officials privately that the special forces being sent to advise Iraqi forces could also be used to call in air strikes if necessary.
Military officials also confirmed on Thursday that US F-18 fighters were already flying F-18 and unmanned surveillance flights over Iraq.
It remains unclear, however, whether ISIL forces, deployed in civilian areas, will provide suitable targets for US aircraft or drones and the danger of casualties in built-up areas could give Washington pause.
The president said he was prepared to send up to 300 military advisors in all to Iraq -- in addition to 175 troops currently protecting the US embassy and 100 more on standby -- to assess how to train, advise and support Iraqi forces.
The US government, which spent billions building up the Iraqi army after disbanding the Sunni-led force of ousted dictator Saddam Hussein, was dismayed by the way some units laid down their arms and fled the advance of ISIL forces.
While Iraqi forces struggled in the early part of the offensive, they now appear to be performing better, and regained full control of the Baiji oil refinery in Salaheddin province on Thursday, officials and witnesses said.
The Pentagon has noted a stiffening or resistance among security forces around Baghdad and a flood of volunteers to Shiite militias may also be easing the situation.
Maliki meanwhile Thursday ordered security officers not serving in active units to report, to bolster forces battling the militant offensive.
Despite opening the way to a more overt role in Iraq, Obama warned that there was no military solution to the crisis.
He said that Maliki's actions could dictate the fate of the country, amid a growing feeling in Washington that the Iraqi leader would do best by moving on.
"The test is before him and other Iraqi leaders as we speak," Obama said.
"Regardless of what's happened in the past, right now is a moment where the fate of Iraq hangs in the balance," he said, calling for an end to mistrust, deep sectarian divides and political opportunism.
While Obama said it was not up to Washington to chose Iraqi leaders, his remarks made clear US patience was wearing thin with Maliki.
Obama also warned Iran, which has cultivated Maliki as a key Shiite ally, that it must also play a positive role -- and that if it did not, could threaten its own security.
"We've indicated to them that it is important for them to avoid steps that might encourage the kind of sectarian splits that might lead to civil war," Obama said.
"(An) Iraq in chaos on their borders is probably not in their interests. But old habits die hard."
Washington has said it is open to working with its old foe to stabilize Iraq, but has ruled out any kind of military cooperation.
Obama also announced a new diplomatic initiative, sending Secretary of State John Kerry to Europe and the Middle East this weekend to consult on next steps with US allies and Iraq's neighbors.
Oil prices soared on Thursday to a new nine-month high point because of the violence in Iraq, and the attack on the country's biggest refinery.
Brent crude for August delivery rallied as high as $114.80 per barrel, reaching a level last seen in September 2013. It later stood at $114.50, up 24 cents from Wednesday's close.
Britain meanwhile banned ISIL, adding it to a list of proscribed organizations along with four other groups linked to the Syrian conflict, as fears grow the radicals could pose a direct threat to European security.
India said it knows the location of its 40 workers abducted from Mosul as several of their families said they spoke with the captured men who were scared but "safe".