Iraqi forces and Sunni militants battled fiercely for control of the nation's largest oil refinery on Wednesday as Prime Minister Nouri al-Maliki went on a diplomatic offensive, reaching out in a televised address to try to regain support from the nation's disaffected Sunnis and Kurds.

Meanwhile, the government asserted that it had retaken partial control of a strategic city near the border with Syria.

Al-Maliki's conciliatory words, coupled with a vow to teach the militants a "lesson," came as almost all Iraq's main communities have been drawn into a spasm of violence not seen since the dark days of sectarian killings nearly a decade ago.

The U.S. has been pressing al-Maliki to adopt political inclusion and undermine the insurgency by making overtures to Iraq's once-dominant Sunni minority, which has long complained of discrimination by his government and abuses by his Shiite-led security forces.

In Washington, President Barack Obama briefed leaders of Congress on options for quelling the al-Qaeda-inspired insurgency, though White House officials said the president had made no decisions about how to respond to the crumbling security situation in Iraq. While Obama has not fully ruled out the possibility of launching airstrikes, such action is not imminent, officials said, in part because intelligence agencies have been unable to identify clear targets on the ground.

Al-Maliki, a Shia, has rejected charges of bias against Iraq's Sunnis and Kurds and has in recent days been stressing that the threat posed by the militant Islamic State of Iraq and Syria, or ISIS, will affect all Iraqis regardless of their ethnic or religious affiliations. He also rejects any suggestion that the Islamic State and other extremist groups enjoy support by disaffected Sunnis fed up with his perceived discrimination.

'National unity'

In a move apparently designed to satisfy Obama's demand for national reconciliation, al-Maliki expressed optimism in a televised address Wednesday over what he called the rise by all of Iraq's political groups to the challenge of defending the nation against the militant threat.

The crisis has led Iraqis to rediscover "national unity," he said.

"I tell all the brothers there have been negative practices by members of the military, civilians and militiamen, but that is not what we should be discussing," al-Maliki said. "Our effort should not be focused here and leave the larger objective of defeating ISIL."

Late Tuesday, the prime minister appeared on television with Sunni and Kurdish leaders. They issued a joint statement about the need to close ranks and stick to "national priorities" in the face of the threat posed by the militants.

Still, al-Maliki's outreach remain largely rhetoric, with no concrete action to bridge differences with Sunnis and Kurds, who have been at loggerheads with the prime minister over their right to independently export oil and over territorial claims.

Beiji oil refinery attack

Al-Maliki's upbeat assessment came as the military said government forces had repelled repeated attacks by the militants on the country's largest oil refinery and retaken parts of the strategic city of Tal Afar, near the Syrian border.

The chief military spokesman, Lt. Gen. Qassim al-Moussawi, said Iraqi army troops had defended the refinery at Beiji, some 250 kilometres north of Baghdad, and 40 attackers were killed in fighting there overnight and early Wednesday.

Members of the Kurdish security forces take part in a military training in Erbil, Iraq. Prime Minister Nouri al-Maliki struck an optimistic tone and vowed to teach Sunni militants a "lesson". (Azad Lashkari/Reuters) CBC correspondent Nahlah Ayed, reporting from the northern city of Erbil, said the attack on the refinery reportedly included rocket-propelled grenades and gunfire.

"It is something that actually was expected by forces in the area," she said. "In fact, just yesterday some of the foreign staff who work at this oil refinery were evacuated because there have been attacks near the area and suggestions that these militants were aiming to get to the oil refinery."

An employee at the oil refinery reached by The Associated Press late Wednesday also said the facility remained in government hands, though one of its fuel tanks was on fire after it was apparently hit by a mortar shell fired by the militants. He spoke on condition of anonymity in exchange for discussing the situation there.

The Beiji refinery accounts for a little more than a quarter of the country's entire refining capacity — all of which goes toward domestic consumption for things like gasoline, cooking oil and fuel for power stations. Any lengthy outage at Beiji risks long lines at the gas pump and electricity shortages, adding to the chaos already facing Iraq.

Video footage posted online showed smoke billowing in the background from an area near the refinery. Another clip uploaded by the Islamic State militants showed heavily armed fighters arriving in the town, waving black flags out of cars. The videos appear genuine and correspond to AP's reporting of the events depicted.

There was no independent confirmation of the military's claims about the Beiji refinery or that its forces had retaken neighborhoods in Tal Afar, which Sunni fighters captured Monday. Both are in territories held by insurgents that journalists have not been able to access. Tal Afar's proximity to the Syrian border strengthens the Islamic State's plan to carve out an Islamic caliphate, or state, stretching across parts of the two countries.

UN chief deeply alarmed

The Iraqi crisis' growing sectarian nature — which al-Maliki vehemently denies — caught the attention of UN chief Ban Ki-moon.

A member from the oil police force stands guard at Zubair oilfield in Basra, southeast of Baghdad. A military spokesman said government forces repelled an attack by militants on the country's largest oil refinery at Beiji. (Essam Al-Sudani/Reuters) In a message to the Organization of Islamic Cooperation Council meeting Wednesday in Jiddah, Saudi Arabia, he called on Iraq's leaders "to come together and agree on a national security plan to address the terrorist threat from ISIL."

"The rapidly deteriorating security situation in Iraq is deeply alarming and increases the sectarian tensions in the region," Ban said. "It is imperative that acts of reprisal be avoided as they can only intensify the cycle of violence."

The campaign by the al-Qaeda-inspired Islamic State militants has raised the specter of the sectarian warfare that nearly tore the country apart in 2006 and 2007, with the popular mobilization to fight the insurgents taking an increasingly sectarian slant, particularly after Iraq's top Shiite cleric made a call to arms on Friday.

The visit to Iraq this week by Gen. Ghasem Soleimani, leader of Iran's secretive Quds Force and its most powerful general , has confirmed longtime suspicions by the Sunnis that al-Maliki was too close to Iran, a mostly Shia non-Arab nation that Sunni Arab states, including powerhouse Saudi Arabia, see as a threat to regional stability.

Threats to Shia shrines

The Islamic State has vowed to march to Baghdad and the Shia holy cities of Karbala and Najaf, home to some of the sect's most revered shrines, in the worst threat to Iraq's stability since U.S. troops left in late 2011. The militants also have tried to capture Samarra, a city north of Baghdad and home to another major Shiite shrine.

Iran has seen thousands volunteer to defend the shrines and its president, Hassan Rouhani, told a crowd at a stadium near the Iraq border: "We declare ... that the great Iranian nation will not miss any effort in protecting these sacred sites."

Al-Maliki insists that the call to arms by the Iranian-born Grand Ayatollah Ali al-Sistani was for all Iraqis and claimed, without producing evidence, that those who responded included Sunnis.

That did not stop a new cycle of sectarian violence, with the spark coming this week from the Islamic State's posting on the Internet of pictures purporting to show its fighters killing scores of captured Shiite soldiers.

That was followed by the slaughter by Shia militiamen of nearly four dozen Sunni detainees in the city of Baqouba, northeast of Baghdad, late Monday, as well as the discovery Tuesday of the bullet-riddled bodies of four young Sunnis in a Shia neighborhood of Baghdad and a bomb attack that killed 12 in an outdoor market in the capital's Shiite Sadr City district.

40 Indian construction workers seized

On Wednesday, a bomb blast killed four and wounded 11 in the mostly Sunni district of Ghazaliyah in western Baghdad.

Meanwhile, the government in India said 40 construction workers have been seized near Iraq's second-largest city, Mosul, which Sunni fighters captured last week.

The Turkish Foreign Ministry said its diplomats were also investigating a Turkish media report that militants grabbed 60 foreign construction workers, including some 15 Turks, near the northern Iraqi oil city of Kirkuk.

Ethnic Kurds now control Kirkuk, moving to fill a vacuum after the flight of Iraqi soldiers. They too are battling the Sunni extremist militants.