Islamic militants overran much of Iraq's second-largest city of Mosul on Tuesday, seizing the governor's headquarters and rampaging through police stations, military bases and the airport as security forces collapsed and abandoned their posts. Gunmen cruised through neighbourhoods, waving black banners while residents fled.

The assault was a heavy defeat for Prime Minister Nouri al-Maliki in the face of a widening insurgency by a breakaway al-Qaeda group, the Islamic State of Iraq and the Levant. The group has been advancing in both Iraq and neighbouring Syria, capturing territory in what appears to be a campaign to set up a militant enclave straddling the border.

Who is Islamic State?

The group that seized Mosul was once al-Qaeda’s branch in Iraq, but under its leader Abu Bakr al-Baghdadi it has grown to operate in both Iraq and in Syria.

In Syria, its fighters attacked pro-Assad forces, earning the reputation of being some of the most ruthless combatants in the years-long civil war.

Interestingly, al-Qaeda kicked The Islamic State out of its terror network for its involvement in the Syrian conflict.  

In Iraq, the group has positioned itself as the Sunni community’s champion against the al-Maliki government, launching attacks in Fallujah, Baghdad and elsewhere.

The U.S. and UN Secretary-General ban Ki-moon condemned the attacks. Ban said he was "gravely concerned" by the serious deterioration of the security situation in Iraq while U.S. State Department spokeswoman Jen Psaki said in a statement that "the situation remains extremely serious," and that U.S. officials "support a strong, coordinated response to push back against this aggression." 

Earlier this year, Islamic State took control another Iraqi city, Fallujah, in the west of the country, and government forces have been unable to take it back. The far larger Mosul is an even more strategic prize. The city and surrounding Ninevah province are a major export route for Iraqi oil and a gateway to Syria."The United States will provide all appropriate assistance to the Government of Iraq under the Strategic Framework Agreement (between the two nations) to help ensure that these efforts succeed," Psaki said.

In a sign of the weight of the blow, al-Maliki pressed parliament to declare a state of emergency that would grant him greater power, saying the public and government must unite "to confront this vicious attack, which will spare no Iraqi."

Regaining Mosul poses a daunting challenge for the Shiite prime minister. The city has a Sunni Muslim majority and many in the community are already deeply embittered against his Shiite-led government. During the nearly nine-year American presence in the country, Mosul was a major stronghold for al-Qaida and U.S. and Iraqi forces carried out repeated offensives there, regaining a semblance of control but never routing the insurgents entirely.

But even when al-Qaeda was strong in Mosul in the past, it never succeeded in outright driving government forces out. Insurgents and Iraqi troops have been fighting for days in the city, but Monday night and into early Tuesday, the security forces' hold appeared to collapse.

Fighters storm police stations, prisons

Insurgents overran the Ninevah provincial government building in the city — a key symbol of state control — in the evening, and the governor fled the city. The fighters stormed police stations, bases and prisons, capturing weapons and freeing prisoners. Security forces melted away, abandoning many of their posts, and militant seized large caches of weapons.

They took control of the city's airport and captured helicopters there, as well as a military airbase 60 kilometers (40 miles) south of the city, the parliament speaker said.

On Tuesday, the militants appeared to hold much of the eastern half of Mosul, which is bisected by the Tigris River. Mosul residents said fighters were raising the black banners that are the emblem of the Islamic State.

'The situation is chaotic inside the city, and there is nobody to help us.'- Mosul resident

Online footage taken from a car driving through the streets of Mosul showed burning vehicles in the streets, black-masked gunmen in pickup trucks mounted with anti-aircraft guns, and residents walking with suitcases — apparently fleeing. The video appeared authentic and matched AP reporting of the events.

A government employee who lives about a mile from the provincial headquarters, Umm Karam, said she left with her family Tuesday morning.

"The situation is chaotic inside the city ,and there is nobody to help us," she said "We are afraid ... There is no police or army in Mosul." She spoke on condition she be identified by a nickname for fear of her safety.

Progress reversed on several fronts

The assault in Mosul is also a sign of Iraq's reversals since American forces left the country in late 2011. The Islamic State has ramped up its insurgency the past two years, presenting itself as the Sunni community's champion against al-Maliki's Shiite-led government.

Iraq Mosul violence

A burnt vehicle sits near the site of clashes between Iraq security forces and the Islamic State in Iraq and the Levant group. (Reuters)

The Mosul crisis comes as al-Maliki is working to put together a new governing coalition after elections last month, and is relying even more on Shiite parties. Sunnis and Kurds have grown increasingly disillusioned with al-Maliki, accusing him of dominating power.

The autonomous Kurdish region in the north has its own armed forces — the peshmerga — and on Tuesday, the region's prime minister suggested his willingness to intervene beyond the formal borders of the self-rule enclave. That could be politically explosive, since the Mosul region lies on Kurdistan's doorstep, has a significant Kurdish population, and the Kurds claim parts of the area as part of the autonomous region.

Kurdistan's prime minister, Nechirvan Barzani, sharply criticized Baghdad's handling of the Mosul crisis, saying the Kurds had tried unsuccessfully to work with the Iraqi security forces to protect the city.

"Tragically, Baghdad adopted a position which has prevented the establishment of this co-operation," he said in a statement.

He urged the Kurds to aid those displaced from Mosul and said the peshmerga are prepared to handle security situation in areas outside the regional government's jurisdiction — presumably referring to areas around Mosul inhabited by Kurds that are disputed with the central government.

State TV said parliament would convene Thursday to vote on a 30-day state of emergency, which requires passage by a two-thirds vote. The declaration would give al-Maliki the "necessary powers" to run the country — something legal experts said could include powers to impose curfews, restrict public movements and censor the media.

With files from Reuters