Thousands of people are fleeing Mosul after Islamic militants overran parts of Iraq's second-largest city. Militants from the breakaway al-Qaeda group, the Islamic State of Iraq and the Levant (ISIL) and Iraqi troops have been fighting for days in Mosul.

Insurgents armed with machine guns and rocket-propelled grenade launchers stormed the provincial headquarters building, overpowering guards in a short firefight, according to Ali Mahmoud, the media official for Nineveh province.

families
Families fleeing violence in Mosul, capital of the northern Nineveh province, gather at a checkpoint.AFP

On Monday night and into Tuesday, the government forces in the city appeared to collapse. Prime Minister Nouri al-Maliki has declared a state of emergency.

Regaining Mosul poses a daunting challenge for al-Maliki. 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-Qaeda. US and Iraqi forces carried out repeated offensives there, regaining a semblance of control but never routing the insurgents entirely.

Burning Iraqi security force vehicles are seen during clashes in the northern Iraq city of Mosul.
Burning Iraqi security force vehicles are seen during clashes in the northern Iraq city of Mosul.Reuters
Iraqi soldiers are shipped north from Najaf to Mosul.
Iraqi soldiers are shipped north from Najaf to Mosul.AFP
An elderly man fleeing the violence is assisted at a checkpoint on the outskirts of Arbil, in Iraq's Kurdistan region.
An elderly man fleeing the violence is assisted at a checkpoint on the outskirts of Arbil, in Iraq's Kurdistan region.Reuters
Iraqis fleeing violence in Nineveh province wait in their vehicles at a checkpoint in Aski kalak after suspected jihadists seized the province and its capital Mosul.
Iraqis fleeing violence in Nineveh province wait in their vehicles at a checkpoint in Aski kalak after suspected jihadists seized the province and its capital Mosul.AFP
A mother holds her child as families fleeing the violence in the Iraqi city of Mosul wait at a checkpoint.
A mother holds her child as families fleeing the violence in the Iraqi city of Mosul wait at a checkpoint.Reuters
Iraqi families fleeing violence in the northern Nineveh province gather at a checkpoint in the autonomous Kurdistan region.
Iraqi families fleeing violence in the northern Nineveh province gather at a checkpoint in the autonomous Kurdistan region.AFP
A woman with a walking stick flees the violence in the Iraqi city of Mosul.
A woman with a walking stick flees the violence in the Iraqi city of Mosul.Reuters
A man, who was injured during a suicide bomber attack in Mwafaqiya village near Mosul, lies in a hospital bed in Arbil, the capital of the autonomous Kurdistan region.
A man, who was injured during a suicide bomber attack in Mwafaqiya village near Mosul, lies in a hospital bed in Arbil, the capital of the autonomous Kurdistan region.Reuters
A wounded Iraqi man lies on a bed at a hospital in Arbil, capital of the autonomous Kurdish region of northern Iraq, following two suicide bombings in a village to the east of Mosul.
A wounded Iraqi man lies on a bed at a hospital in Arbil, capital of the autonomous Kurdish region of northern Iraq, following two suicide bombings in a village to the east of Mosul.AFP

ISIL, which was once al-Qaida's branch in Iraq, was thrown out of the terrorist network after it expanded its operations in Syria against the orders of al-Qaida leader Ayman al-Zawahiri. It is considered one of the most ruthless rebel forces fighting to topple President Bashar Assad in Syria, where it has in seized a major city in the east and other territory.

In Iraq, the group rose up earlier this year to take over Fallujah and parts of the nearby city of Ramadi, the capital of Anbar province. It has also been carrying out a campaign of bombings and other violence in Baghdad and other parts of the country.