ISLAMIC militants have overrun parts of Iraq's second-largest city, driving security forces from their posts and seizing the provincial government headquarters, security bases and other key buildings.

The battle for Mosul is a serious blow to Baghdad's attempts to tame a widening insurgency by a break­away al Qaeda group, the Islamic State of Iraq and the Levant.

Earlier this year, the group took over another Iraqi city, Fallujah, in the west of the country, and government forces have been unable to take it back after months of fighting.

Prime Minister Nouri al Maliki asked parliament to declare a state of emergency after the assault on Mosul. In a nationally televised press conference, he called for an urgent session for policy makers to win backing for the move.

"Iraq is undergoing a difficult stage," he said, acknowledging that militants had taken control of vital areas in Mosul, and saying the public and government must unite "to confront this vicious attack, which will spare no Iraqi".

Under the constitution, p­arliament can declare a 30-day state of emergency on a two-thirds vote by its members, granting the Prime Minister the necessary powers to run the country.

The insurgents took control of Mosul's government complex for northern Ninevah province - a key symbol of state authority - on Monday night after days of fighting in the city, 225 miles north-west of Baghdad.

Mosul residents said the ­militants appeared to be in control of several parts of the city, raising the black banners that are the emblem of the Islamic State.

The gunmen overran police stations and several prisons, setting free detainees who were seen running in the streets in their yellow jumpsuits, the residents said.

The fighters also seized he­licopters at Mosul airport and seized weapons depots, according to parliament speaker Osama al Nujaifi, a Sunni from Mosul.

South of Mosul, several villages and a military air base around the town of Shurqat, in Salahuddin province, also fell to militants, Mr al Nujaifi said.

He added: "What happened is a disaster by any standard. The presence of these terrorist groups in this vast province threatens not just the security and the unity of Iraq, but the whole Middle East."

Mosul and Ninevah province is a key strategic area, a gateway to neighbouring Syria, where Islamic State has also grabbed swaths of territory. The Islamic State of Iraq and the Levant has been behind a wave of violence in Iraq, claiming to be the champion for Iraq's large and disaffected Sunni minority against the Shiite-led government, and it is also considered one of the most ruthless rebel forces fighting to topple president Bashar Assad in Syria.

Meanwhile, at least 15 people have been killed and more than two dozen wounded in a bomb attack on a funeral in the central Iraqi city of Baqouba.

The explosion struck mourners gathered for the funeral of a Sunni university professor killed on Monday.

Police officials said the attack killed 15 people and wounded at least 27. A hospital official confirmed the casualties.

Baqouba, about 35 miles north east of Baghdad, is home to both Sunnis and Shiiites.