The threat to the Baiji refinery comes after militants from the Islamic State in Iraq and the Levant (ISIL) seized the northern city of Mosul, advancing their aim of creating a Sunni Caliphate straddling the border between Iraq and Syria.
The fall of Mosul, Iraq's second biggest city, is a blow to Prime Minister Nuri al-Maliki's attempts to defeat the militants, who have seized territory in Iraq over the past year following the withdrawal of U.S. forces.
About 500,000 Iraqis have fled Mosul, home to 2 million people, and the surrounding province, many seeking safety in the autonomous Kurdistan region.
Having also taken two small towns north of Baghdad, Dhiluiya and Yathrib, the insurgents are in control of between 10 and 15 pct of Iraqi territory, excluding Kurdistan, and have led many Iraqis to fear they have the capital, Baghdad, in their sights.
Security sources said ISIL militants on Wednesday drove more than 60 vehicles into Tikrit, the home town of former Iraqi dictator Saddam Hussein, which lies about 100 miles (160 km) north of Baghdad.
The militants occupied the provincial government headquarters and raised the black flag of ISIL.
"Our forces were caught by surprise, they never expected ISIL would use police and army Humvee vehicles, we mistook them for government forces and it was too late to stop them," said a police captain who fled from Tikrit to Samarra.
"We are fighting devils and not ordinary people".
Around 100 ISIL fighters held mass prayers in central Tikrit after taking control.
Foreign Minister Hoshyar Zebari said Iraq's leaders must unite to face a "mortal" threat. "There has to be a quick response to what has happened," he said during a trip to Greece.
Zebari said Baghdad would work with forces from Kurdistan in the north to drive the fighters out of Mosul after Iraqi security forces there fled on Tuesday.
Maliki described the fall of Mosul as a "conspiracy" and said those who had abandoned their posts would be punished. He also said Iraqis were volunteering in several provinces to join army brigades to fight ISIL.
In a show of the militants' reach, a car bombing in a crowded market in the town of Safwan, which sits on Iraq's southernmost border with Kuwait, killed five people.
In a statement on its Twitter account, ISIL said it had taken Mosul as part of a plan "to conquer the entire state and cleanse it from the apostates", referring to the province of Nineveh of which the city is the capital.
Militants executed 10 soldiers and policemen on Wednesday near the town of Riyadh, 60 km (40 miles) southwest of Kirkuk, after setting up a checkpoint on the road, police sources said, while in Tikrit six police officers were executed.
In Mosul, 80 Turkish citizens were being held hostage by the militants, the foreign ministry in Ankara said. Turkey threatened to retaliate if any of the group, which included special forces soldiers, diplomats and children, were harmed.
Ambassadors of the NATO defence alliance held an emergency meeting in Brussels at Turkey's request and Prime Minister Tayyip Erdogan held talks with U.S. Vice President Joe Biden about the developments.
ISIL, led by Abu Bakr al-Baghdadi, broke with al Qaeda's international leader, Osama bin Laden's former lieutenant Ayman al-Zawahri, and has clashed with al Qaeda fighters in Syria.
ISIL's advances show that Iraq's security forces - trained and equipped by Washington at a cost of nearly $25 billion and numbering more than a million - are outmatched against insurgents who once took on the might of the United States.
Overnight on Tuesday, ISIL militants moved on Baiji, home to Iraq's largest refinery, which can process 300,000 barrels per day and supplies oil products to most of Iraq's provinces and as well as Baghdad.
Security sources said the fighters drove into the town of Baiji in armed vehicles, torching the court house and police station before freeing prisoners.
The militants later withdrew into surrounding villages after tribal leaders persuaded them not to take over the energy installations in Baiji, local officials and residents said.
However, the violence in Iraq prompted fears about the outlook for oil supplies, with futures prices in New York pushed higher towards $110 a barrel.
ISIL has become a dominant player in Iraq and Syria, where it has seized a string of cities over the past year, often fighting other Sunni groups.
The United States expressed concern about the deteriorating security situation in Iraq and pledged "any appropriate assistance" to help the Iraqi government.
White House spokesman Josh Earnest told reporters on Air Force One: "There's no doubt that the situation has deteriorated over the last 24 hours.
"The deterioration of security is rapidly becoming a humanitarian issue and requires a coordinated response by Iraqi leaders across the country to halt the advances that the ISIL has made and regain control of territory currently in ISIL's hands," he added.
In Washington, State Department spokeswoman Jen Psaki said the United States believed that the Baiji refinery remained under control of the Iraqi government.
ISIL control in the Sunni Anbar province as well as around Mosul would help the Islamist group consolidate its grip along the frontier with Syria, where it is fighting President Bashar al-Assad, an ally of Shi'ite Iran.
Members of Iraq's Shi'ite majority have also been crossing the border to fight in Syria alongside Assad's forces.
In Sadr city, a Shi'ite slum in Baghdad, men were stockpiling weapons in anticipation of a battle against ISIL.
"The army has proven to be a big failure. People have begun to depend on themselves because ISIL may enter Baghdad any minute," said Muhannad al-Darraji from Sadr City.
At about the same time, a suicide bomber blew himself up in Sadr City, killing at least 38 people. A further 18 people were killed when a car bomb exploded near the northern Kadhimiya district, where there is a Shi'ite shrine.
The governor of Mosul blamed Maliki for failing to act upon his warnings about the threat of ISIL.
"The entry of ISIL to Mosul was through the desert from Syria," Atheel al-Nujaifi said. "There are camps in the desert and we have repeatedly asked the government to bomb these camps instead of luring ISIL into the cities to fight it."
At a checkpoint on the road between Mosul and Arbil, residents who fled with little more than the clothes on their backs were stunned by the turn of events.