An estimated half a million people are said to be fleeing Iraq's second largest city, Mosul, after fighters from the Islamic State of Iraq and the Levant (ISIL), an al-Qaeda splinter group, seized the city.

ISIL fighters overran Iraqi security forces in Mosul, capital of the northern Nineveh province, on Tuesday, prompting tens of thousands to leave their homes.

The Geneva-based International Organisation for Migration (IOM) said the takeover had "displaced over 500,000 people in and around the city".

Al Jazeera's Imran Khan, reporting from Baghdad on Wednesday, said aid agencies were under pressure to deliver humanitarian aid as nobody had expected Mosul to fall quite so dramatically.

"Aid agencies will be scrambling to help the internally displaced. As most of the refugees will be heading to Erbil, they will need the help of the Kurdistan Regional Government to help the affected," he said.

Baiji incursion

Earlier on Wednesday, ISIL had sought to expand its influence by advancing into the oil-refinery town of Baiji before Iraq's Fourth Armoured Divison forced the group to retreat.

The group had threatened local police and soldiers not to challenge them and warned the town's most prominent tribal sheikhs to lay down their weapons.

"We are coming to die or control Baiji, so we advise you to ask your sons in the police and army to lay down their weapons."

Tuesday's dramatic developments saw ISIL take control of Mosul airport, storm government buildings, TV stations, banks and free an estimated 2,400 prisoners from jails in the northern Nineveh province.

Mosul, which has a population of almost two million, is also the main export route for Iraq's oil.

Nouri al-Maliki, the Iraqi prime minister, called a national state of emergency after his government lost control of Mosul and parts of Nineveh.

"We will not allow Mosul to be under the banner of terrorism, We call on all international organisations to support Iraq and its stance in fighting terrorism. The entire world will suffer if terrorism spreads." Maliki said.

He said the government would arm civilians who volunteered "to defend the homeland and defeat terrorism".

IOM reported that about half a million Iraqis had fled their homes following the city's fall, fearing increased violence.

The US, which invaded Iraq in 2003, condemned the seizure of Mosul and described the situation as "extremely serious".

"ISIL is not only a threat to the stability of Iraq, but a threat to the entire region," Jen Psaki, US State Department spokeswoman, said, adding that the US backed "a strong coordinated response".

'Dereliction of duty'

Osama al-Nujaifi, Iraq's parliamentary speaker, said Iraqi soldiers abandoned their posts in Mosul when the attack began, action he described as "a dereliction of duty".

Nujaifi said parliament would discuss the call for a state of emergency on Thursday.

Nujaifi, who is the brother of Atheel al-Nujaifi, Nineveh's governor, said Wednesday he was mobilising popular committees to rid the city of ISIL and terror groups.

"We've introduced practical steps to try to bring back a new system in Nineveh, by mobilising people in popular committees to try to win back Mosul."

Al Jazeera's Khan said Maliki faces opposition to his call for a state of emergency, which would grant him sweeping powers.

"Many politicians have vocally criticised Maliki's handling of the crisis," our correspondent said. .

"Many in Iraq are asking why a lightly armed group like ISIL have been able to take over huge cities.

"Some here worry that a state of emergency will give Maliki sweeping powers that once he has, he may well find difficult to give up."

Feisal Istrabadi, a former Iraqi ambassador to the UN, told Al Jazeera that remnants of the former Iraqi army could have been involved in the Nineveh attack.

"I'm hearing sort of word from Baghdad that is quite possible that there are elements of the former Iraqi army that is to say army before 2003 that may be involved in the event in Mosul, and actually it is gone beyond Mosul," Istrabadi said.

Reports by AFP news agency later on Tuesday quoted Iraqi police sources as saying fighters had taken over areas of Kirkuk and Salaheddin province.

Meanwhile, Syrian activists said ISIL fighters had taken over the Syrian side of al-Yaroubiya crossing, one of three crossings into Iraq.