By Ghazwan Hassan and Phil Stewart

BAGHDAD/WASHINGTON, June 18 (Reuters) - Iraq has asked the United States for air support in countering Sunni rebels, the top U.S. general said on Wednesday, after the militants seized major cities in a lightning advance that has routed the Shi'ite-led government's army.

However, General Martin Dempsey, the chairman of the U.S. military's Joint Chiefs of Staff, gave no direct reply when asked at a Congressional hearing whether Washington would agree to the request.

Baghdad said it wanted U.S. air strikes as the insurgents, led by fighters from the Islamic State of Iraq and the Levant (ISIL), battled their way into the biggest oil refinery in Iraq and the president of neighboring Iran raised the prospect of intervening in a sectarian war that threatens to sweep across Middle East frontiers.

"We have a request from the Iraqi government for air power," Dempsey told a Senate hearing in Washington. Asked whether the United States should honor that request, he said: "It is in our national security interest to counter ISIL wherever we find them."

In the Saudi city of Jeddah, Iraqi Foreign Minister Hoshyar Zebari said Baghdad had asked for air strikes "to break the morale" of ISIL.

While Iraq's ally, Shi'ite Muslim power Iran, had so far not intervened to help the Baghdad government, "everything is possible", he told reporters after a meeting of Arab foreign ministers.

The White House has said President Barack Obama has not yet decided what action, if any, to take following the rebel onslaught, and was due to discuss the options with leaders of Congress later on Wednesday.

U.S. officials, speaking on condition of anonymity, said the Iraqi request had included drone strikes and increased surveillance by U.S. drones, which have been flying over Iraq for some time.

However, any air targets would be hard to identify because the militants did not have traditional supply lines or major physical infrastructure and mingled with civilians.

REFINERY BATTLE

Sunni fighters were in control of three quarters of the territory of the Baiji refinery north of Baghdad, an official said there, after a morning of heavy fighting at gates defended by elite troops who have been under siege for a week.

ISIL aims to build a Sunni caliphate ruled on medieval precepts, but the rebels also include a broad spectrum of more moderate Sunnis furious at what they see as oppression by Baghdad.

Some international oil companies have pulled out foreign workers. The head of Iraq's southern oil company, Dhiya Jaffar, said Exxon Mobil had conducted a major evacuation and BP had pulled out 20 percent of its staff. He criticized the moves, as the areas where oil is produced for export are mainly in the Shi'ite south and far from the fighting.

Washington and other Western capitals are trying to save Iraq as a united country by leaning hard on Shi'ite Prime Minister Nuri al-Maliki to reach out to Sunnis. Maliki met Sunni and Kurdish political opponents overnight, concluding with a frosty, carefully staged joint appearance at which an appeal for national unity was read out.

In a televised address on Wednesday Maliki appealed to tribes 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 - many believed to be funded and backed by Iran - have mobilized to halt the Sunni advance, as Baghdad's million-strong army, built by the United States at a cost of $25 billion, crumbles.

Maliki announced on Wednesday that 59 officers would be brought to court for fleeing their posts last week as the insurgents seized Mosul, northern Iraq's biggest city.

HOLY SHRINES

Like the civil war in Syria next door, the new fighting threatens to draw in regional neighbors, mustering along sectarian lines in what fighters on both sides depict as an existential struggle for survival based on a religious rift dating to the 7th century.

Iranian President Hassan Rouhani made the clearest declaration yet that the Middle East's main Shi'ite power, which fought a war against Iraq that killed a million people in the 1980s, was prepared to intervene to protect Iraq's great shrines of Shi'ite imams, visited by millions of pilgrims each year.

"Regarding the holy Shi'a shrines in Karbala, Najaf, Kadhimiya and Samarra, we announce to the killers and terrorists that the great Iranian nation will not hesitate to protect holy shrines," Rouhani said in an address to a crowd on live TV.

He said many people had signed up to go to Iraq to fight, although he also said Iraqis of all sects were prepared to defend themselves: "Thanks be to God, I will tell the dear people of Iran that veterans and various forces - Sunnis, Shias and Kurds all over Iraq - are ready for sacrifice."

Iraqi troops are holding off Sunni fighters outside Samarra north of Baghdad, site of one of the main Shi'ite shrines. The fighters have vowed to carry their offensive south to Najaf and Kerbala, seats of Shi'ite Islam since the Middle Ages.

Saudi Arabia, the region's main Sunni power, said Iraq was hurtling towards civil war. Foreign Minister Prince Saud al-Faisal, in words clearly aimed at Iran and at Baghdad's Shi'ite rulers, deplored the prospect of "foreign intervention" and said governments need to meet "legitimate demands of the people".

Maliki's government has accused Saudi Arabia of promoting "genocide" by backing Sunni militants. Riyadh supports Sunni fighters in Syria but denies aiding ISIL.

The Baiji refinery is the fighters' immediate goal, the biggest source of fuel for domestic consumption in Iraq, which would give them a grip on energy supply in the north where the population has complained of fuel shortages.

The refinery was shut on Tuesday and foreign workers flown out by helicopter.

"The militants have managed to break into the refinery. Now they are in control of the production units, administration building and four watch towers. This is 75 percent of the refinery," an official speaking from inside the facility said.

The government denied the refinery had fallen. Counter-terrorism spokesman Sabah Nouri insisted forces were still in control and had killed 50 to 60 fighters and burned six or seven insurgent vehicles after being attacked from three directions.

Oil prices rose on news the refinery was partly in rebel hands.

FROSTY MEETING

Last week's sudden advance by ISIL - a group that declares all Shi'ites to be heretics deserving death and has proudly distributed footage of its fighters gunning down prisoners lying prone in mass graves - is a test for Obama, who pulled U.S. troops out of Iraq in 2011.

Obama has ruled out sending back ground troops and U.S. officials have even spoken of cooperating with Tehran against the mutual enemy. However, the White House said more talks with Iran about dealing with the crisis in Iraq, which have taken place on the sidelines of meetings on Tehran's nuclear program, are unlikely for the time being.

U.S. and other international officials insist Maliki must do more to address the widespread sense of political exclusion among Sunnis, the minority that ran Iraq until U.S. troops deposed dictator Saddam Hussein after the 2003 invasion.

U.S. Senate Majority Leader Harry Reid said he did not back sending U.S. troops into the conflict in Iraq, which he described as a "civil war".

Reid and three other congressional leaders - Senate Republican leader Mitch McConnell, House of Representatives Speaker John Boehner and House Democratic Leader Nancy Pelosi - are meeting Obama later on Wednesday.

Western countries fear an ISIL-controlled mini-state in Syria and Iraq could become a haven for militants who could then stage attacks around the globe.

In a rerun of previous failed efforts at bridging sectarian and ethnic divisions, Shi'ite, Sunni and Kurdish leaders met late on Tuesday behind closed doors. They later stood before cameras as Ibrahim al-Jaafari, a Shi'ite politician who held the post of prime minister before Maliki, read a statement.

"No terrorist powers represent any sect or religion," Jaafari said in the address, which included a broad promise of "reviewing the previous course" of Iraqi politics. Afterwards, most of the leaders, including Maliki and Usama al-Nujaifi, the leading Sunni present, walked away from each other in silence.

Though the joint statement said only those directly employed by the Iraqi state should bear arms, thousands of Shi'ite militiamen have been mobilized to defend Baghdad.

With battles now raging just an hour's drive north of the capital, Baghdad is on edge. The city of 7 million people saw fierce sectarian street fighting from 2006-2007 and is still divided into Sunni and Shi'ite districts, some protected by razor wire and concrete blast walls. (Addtional reporting by Ghazwan Hassan, Ahmed Rasheed, Ned Parker, Oliver Holmes, Mark Hosenball, Amena Bakr and Yara Bayoumi; Writing by Giles Elgood and David Stamp; Editing by Will Waterman and Robin Pomeroy)