Iraq is facing its gravest test since the US-led invasion more than a decade ago, after its army capitulated to Islamist insurgents who have seized four cities and pillaged military bases and banks, in a lightning campaign which seems poised to fuel a cross-border insurgency endangering the entire region.

The extent of the Iraqi army's defeat at the hands of militants from the Islamic State of Iraq and Syria (Isis) became clear on Wednesday when officials in Baghdad conceded that insurgents had stripped the main army base in the northern city of Mosul of weapons, released hundreds of prisoners from the city's jails and may have seized up to $480m in banknotes from the city's banks.

Iraqi officials told the Guardian that two divisions of Iraqi soldiers – roughly 30,000 men – simply turned and ran in the face of the assault by an insurgent force of just 800 fighters. Isis extremists roamed freely on Wednesday through the streets of Mosul, openly surprised at the ease with which they took Iraq's second largest city after three days of sporadic fighting.

Senior government officials in Baghdad were equally shocked, accusing the army of betrayal and claiming the sacking of the city was a strategic disaster that would imperil Iraq's borders.

The developments seriously undermine US claims to have established a unified and competent military after more than a decade of training. The US invasion and occupation cost Washington close to a trillion dollars and the lives of more than 4,500 of its soldiers. It is also thought to have killed at least 100,000 Iraqis.

Early on Thursday the Sites monitoring group in the US said it had translated an audio statement by an Isis spokesman declaring that "the battle will rage in Baghdad and Karbala ... put on your belts and get ready". The New York Times, meanwhile, reported that Iraq last month secretly asked Barack Obama to consider bombing Sunni militant staging posts in Iraq.

In a day of extraordinary developments on Wednesday, Isis gunmen also encircled the city of Deir el-Zour across the border in Syria, kidnapped 80 Turkish citizens in two mass abductions, made advances in two other provinces and claimed to have successfully smuggled a huge weapons haul to eastern Syria's Hassaka province.

Isis fighters rode unopposed into Saddam Hussein's birthplace of Tikrit. There, as in Mosul the day before, they quickly set up checkpoints, sacked government buildings and filled trucks with weapons and cash, some of which were quickly dispatched to Syria.

Militants seized the Turkish consulate in Mosul and kidnapped the head of the diplomatic mission along with 24 staff members. A local police colonel told AFP he had spoken with the kidnappers who said those held "are safe with us" and would be moved to a "safer place". Turkish forces have targeted Isis forces in Syria.

Militants also destroyed a police station in Baiji, site of Iraq's largest refinery. Local officials said the insurgents withdrew after local tribal leaders persuaded them not to seize the refinery and power stations. At least half a million residents of northern Iraq are reported to be on the move, with most attempting to flee to the Kurdish far north where border officials were overwhelmed and expecting refugee numbers to increase sharply in coming days.

Gunmen drive in a pickup truck on a street in Tikrit, northern Iraq. Photograph: EPA

The UN said it was scrambling to deal with the crisis. Save the Children said: "We are witnessing one of the largest and swiftest mass movements of people in the world in recent memory. The majority of Iraqis fleeing Mosul had to escape in a matter of minutes."

As security unravelled in the country's north and centre, the radical Shia Islamic leader Moqtada al-Sadr threatened to reform the Mahdi army – a key protagonist in the sectarian war that nearly ripped Iraq apart in the wake of the US invasion. Militias had primacy nationwide during the worst of the war years and are once again ascendant as the Iraqi military's authority crumbles.

Foreign minister Hoshyar Zebari urged Kurdish and central government leaders to set aside their differences to deal with the "mortal threat" facing the country. Kurdish authorities were letting nearly all new arrivals enter in an early sign of closer than normal cooperation.

For a second day, the road between Mosul and Kirkuk was choked with cars full of families who described chaos in the city as troops beat an undignified retreat.

Abu Abdulla, a 55-year-old who had just arrived in Irbil, said: "Suddenly the army withdrew and there was no army nor police, just the militants; we don't know where they are from; they are masked."

So many soldiers had fled Mosul that the price of firearms plummeted as troops flooded the market with their service weapons, said Shirzad, a taxi driver at the border of Iraqi Kurdistan, who had been ferrying Iraqi army deserters from the checkpoint towards Kirkuk.

Isis released footage of large numbers of weapons and armoured military vehicles being received by members in eastern Syria, confirming fears that the looted weapons would fuel the insurgency on both sides of an increasingly irrelevant border. Sources in the Syrian city of Hassaka confirmed to the Guardian that large convoys of trucks carrying weapons arrived late on Tuesday and were met by a senior Isis figure, Omar al-Chechani.

Statements released by the group claimed that the assault on Mosul was the beginning of the end of the Sykes Picot agreement - the post-colonial settlement which in 1916 enshrined the nation states of Syria and Lebanon and influenced the drawing of the Jordan and Iraq borders. Isis commanders say they are fighting to destroy the post-Ottoman nation state borders and restore a caliphate that submits to fundamentalist Islamic law.

The group has been steadily building towards such an outcome, rampaging first through northern Syria and then back into Anbar province, the heartland of its earliest incarnation almost 10 years ago. Along the way, it has steadily accrued weapons and gained confidence, storming unopposed into towns and cities that were notionally protected by the best trained and armed military in the Arab world.

However, Mosul is by far its biggest prize so far: a gain that will seriously undermine Nour al-Maliki's efforts to be renominated as prime minister for a third term - and cripple the standing of the military, regarded for the past three years as the most important institution in the land. Any counter-offensive against Isis is expected to be led instead by Kurdish Peshmurga forces, which remain fiercely loyal to Kurdish leaders, but not to Baghdad.

A spokesperson for the Peshmurga, Brigadier General Halgord Hekmat, told the Guardian that "the sudden collapse of the Iraqi army has left us with no option but to fill some areas with our forces because we can't have a security vacuum on our border".

Maliki accused some senior military figures of "negligence" and "betrayal", attempting to deflect blame for the rout. As commander in chief, Maliki has ultimate responsibility for Iraq's armed forces and has presided over a series of spectacular defeats at the hands of Isis, starting last July when Abu Ghraib prison on Baghdad's western outskirts was overrun by the extremist group in a raid that freed several hundred convicted terrorists.

In December parts of Fallujah and Ramadi - both former al-Qaida strongholds - were retaken by the group, which has ever since deterred Iraqi forces from trying to re-enter the cities and maintained a withering insurgency in the nearby countryside.

"I know the reasons why the army collapsed," Maliki said. "But now is not the time to point the blame to whoever ordered the army to fall back. Even if it's a ploy, the generals who are responsible must be held accountable. A conspiracy has led Isis to occupy Mosul. Whoever is responsible will not get away with that they did."

Most of the weapons seized by Isis were taken from the al-Qayara base in Mosul, the fourth largest in the country, after two divisions of the Iraqi army fled the city en masse on Tuesday, allowing a far smaller extremist force to enter.

The haul included armoured humvees, rockets, tonnes of ammunition and assault weapons. Evidence of the large-scale desertion remained littered across the streets of the central city, with flak jackets, camouflage uniforms and ammunition clips being held up by insurgents as they celebrated their victory.

Hamad al-Mutlaq, a member of the Iraqi parliament's defence committee, said: "I'm convinced that what happened in Mosul is deliberate negligence or there is an agreement between the parties because it's impossible for an army to be unable to stand up to a group made up of hundreds of men."

"Isis can't have had more than a few thousand men versus two divisions made up of 30,000 Iraqi soldiers. This signifies that the army has been built on weak foundations. The Iraqi government is the one to blame and should be held responsible for this failure; it has been unable to build a healthy state and unable to defend it."

Atheel al-Nujaifi, governor of Ninevah province, who fled Mosul along with the city's chief of police, said on Wednesday Iraqi authorities were determined to recapture the northern city.

"Mosul is capable of getting back on its feet and getting rid of all the outsiders …and we have a plan to restore security," he said. "We have taken practical steps in order to restore order … by mobilising people into public committees that would retake the city."

Al-Mutlaq believes the city has been lost to Isis. "I don't think the government is able to retake Mosul. After eight years, it shows that all its plans have been faulty," he said.

Not all Mosul residents condemned the Isis rout. Ali Aziz, 35, a humanitarian worker, said: "We got statements by them confirming that they won't cause harm to anyone and all the minorities will be protected by them. They are really welcomed and we are so happy to have them rather than having Maliki's bloody, brutal forces.

"I feel we have been liberated of an awful nightmare that was suffocating us for 11 years. The army and the police never stopped arresting, detaining and killing people, let alone the bribes they were taken from the detainees' families.

"Me and my neighbours are waiting for the news that the other six Sunni protesting provinces falling in the hand of the Isis fighters to declare our Sunni region like the three provinces in Kurdistan."

Susan Rice, Obama's national security adviser, said the US would "ramp up" its support to the moderate Syrian opposition, Isis's ostensible rivals for control of the Syrian resistance to Bashar Assad. Assad's sponsors, the Iran government, hold significant influence over the Iraqi government that the US also supports.

• Additional reporting: Mona Mahmood, Naziha Baasiri, Saalim Rizk and Yousif al-Timimi