BAghdad // Militants seized the Iraqi city of Tikrit on Wednesday but their assault on Samarra was repulsed as a lightning offensive launched in Mosul swept closer to Baghdad.

Since the Islamic State of Iraq and the Levant began their spectacular assault in Mosul late on Monday, militants have captured a large swathe of northern and north-central Iraq, prompting as many as half a million people to flee their homes.

In Mosul and surrounding areas, more than 150,000 troops fled their posts as the militants advanced, leaving behind thousands of weapons, including tanks and helicopters, that are now in ISIL’s possession, said Jabbar Yawer, a spokesman for ethnic Kurdish armed forces in Erbil.

The speed with which ISIL and its allies have advanced after their seizure on Tuesday of Mosul – a city of two million people – has sent alarm bells ringing not only in Baghdad but in western capitals.

It has also triggered a hostage crisis for Ankara, which is scrambling to secure the release of 48 Turks taken hostage by militants who stormed the country’s consul in Mosul. Another 32 Turkish hostages, believed to be lorry drivers, are being held with them.

In a statement on Twitter, ISIL vowed that it would “not stop this series of blessed invasions” that has seen the fall of the whole of Nineveh province in the north and swathes of Kirkuk and Saleheddin provinces further south.

Tikrit – hometown of executed dictator Saddam Hussein – was the second provincial capital to fall in as many days as ISIL and its allies captured a string of mainly Sunni Arab towns where resentment against the Shiite-led government runs deep.

“All of Tikrit is in the hands of the militants,” a police colonel said of the Salaheddin provincial capital, which lies roughly halfway between Baghdad and Mosul.

A police major said the militants had freed about 300 inmates from a prison there.

After Tikrit’s fall, the operation spread down the main highway towards Baghdad, with militants battling security forces on the northern outskirts of Samarra, just 110 kilometres from the capital.

Iraqiya state television said security forces launched airstrikes on them, and witnesses said the clashes ended without the militants entering the city.

It was not immediately clear what became of the attackers.

Militants had tried to seize the city late last week, and were only halted by a massive deployment of troops, backed by tribal militia and air power.

Although Samarra is mainly Sunni Arab, its control is sensitive for the government as it is home to a shrine revered by the country’s Shiite majority.

A 2006 bombing of the mausoleum by Al Qaeda sparked a Shiite-Sunni sectarian conflict that left tens of thousands dead.

In other developments, a series of bombings, including a suicide attack on tribal leaders in Baghdad, killed 37 people in Shiite areas of central and southern Iraq, officials said.

The lightning advance by ISIL, a breakaway faction of Al Qaeda, poses significant challenges to Baghdad, with the New York-based risk consultancy Eurasia Group saying they would be bolstered by cash from Mosul’s banks, hardware from military bases and hundreds of men they freed from prison.

Prime minister Nouri Al Maliki has responded by asking parliament to declare emergency rule and saying citizens would be armed to fight them.

Echoing Mr Al Maliki’s vow to arm citizens who volunteer to fight militants, the powerful Shiite cleric Moqtada Al Sadr, who led the once-feared Mahdi Army militia, on Wednesday called for the formation of units to defend religious sites in Iraq.

Washington has warned that ISIL threatened the entire region.

The nominee as the next US ambassador to Iraq, Stuart Jones, said it was “one of the most dangerous terrorist groups in the world”.

He also said Washington would “work with our international partners to try to meet the needs of those who have been displaced”.

The International Organisation for Migration said its sources in Mosul estimated the violence leading up to the militants’ takeover “displaced over 500,000 people in and around the city”.

On Wednesday, gunmen in military uniforms and all-black clothing guarded government buildings and banks in the city, residents said.

Militants called over loudspeakers for government employees to go back to work.

“I did not open the door of the shop since last Thursday because of the security conditions,” said Abu Ahmed, a 30-year-old shopkeeper.

Known for its ruthless tactics and suicide bombers, ISIL is arguably the most capable force fighting president Bashar Al Assad inside Syria as well as the most powerful militant group in Iraq.

ISIL is led by the shadowy Abu Bakr Al Baghdadi and backed by thousands of Islamist fighters in Syria and Iraq, many of them westerners.

On Wednesday, the Syrian government said it was ready to help Baghdad in its fight against “terrorism,” while the rebel Free Syrian Army called for support from Arab states for its own battle against ISIL in Syria.

Iran on Wednesday also offered its support to the Iraqi government, with the Iranian foreign minister Mohammad Javad Zarif calling for “effective international support” for Baghdad.

* Associated Press