BAGHDAD - The line outside the Iraq passport documentation office stretches down the street. The people of Baghdad are fleeing an insurgency barely a dozen miles from the capital. "People panic. They watch the news and they think the armed groups are right here in Baghdad," said Ali Nejim, a 20-year-old shopkeeper across the street from the line.
The militant offensive, spearheaded by the puritanical Sunni Islamic State in Iraq and the Levant (ISIL) in alliance with anti-government tribes, has seized majority Sunni areas across the north and west of the country.
The fighters' rapid advance has halted about an hour's drive north of the capital and even closer on its western outskirts, bringing renewed fear to a city of 7 million people where memories of a sectarian bloodbath are still fresh and daily suicide bombings are still as routine as the weather.
The Iraqi capital somehow functions as a city despite never healing from the intense street fighting of 2006-2007. It is mainly divided into Sunni and Shi'ite neighbourhoods, some still sealed off by razor wire and concrete blast walls.
Although outright war has not been fought in the capital for years now, Sunni militants regularly detonate bombs intended to kill Shi'ite civilians. The busy market street where Nejim's shop is a frequent target for car bomb attacks.
The insurgent advance of the past two weeks raises the prospect that the underlying violence could again erupt into outright sectarian war, with civilians the target. "Some of my neighbours sold their houses and left. I'm staying because if I don't, nobody will be left," Nejim said, in his shop that sells sweets, drinks and coffee. The restaurant next door was bombed earlier this year, he said.
Still, he said he was certain Baghdad would not quickly fall to insurgents, like Mosul and Tikrit two weeks ago. "Mosul fell because they are majority Sunni," said shopkeeper Nejim. "Baghdad is mixed and even the Sunnis here support the government," he added. Nejim's family is split. His father is Shi'ite and his mother is Sunni.
In mixed neighbourhoods where the threat of sectarian fighting is greatest, residents are taking no chances.
In the north Baghdad district of Ghazaliyah, a neighbourhood split between Sunnis and Shi'ites, there has been an exodus of families who fear their neighbourhood could become a focal point for sectarian attacks.
When ISIL took Mosul on June 10, Sunni and Shi'ite residents started to move to other parts of Baghdad. The main street is now close to empty, with only a few families remaining. "They are scared," said a resident who asked to remain anonymous for security reasons. "The Shi'ites have retreated to Shi'ite areas and the Sunnis to Sunni areas. There are only six or seven families left on my street now," he said.
Residents of other districts say the same has happened in other mixed neighbourhoods.
The immediate fear in Baghdad is that Sunni sleeper cells loyal to ISIL will stage hit-and-run attacks and car bombings. These could be backed up by militants from outside the city who now have US-made armoured vehicles and heavy artillery.
Iraqi officials worry they could push into the city from Sunni suburbs on the outskirts.
Security has been beefed up. Soldiers in US Army-style desert camouflage stand on pavements. The past two weeks have seen traffic jams as vehicle checkpoints have increased.
The government has mobilised Shi'ites as volunteers for the front lines. Militia from the civil war days are reforming.
Shi'ite cleric Muqtada al-Sadr's black-clad Mehdi Army fighters, which once controlled swathes of Baghdad and southern Iraq but lay down arms in 2008, staged a "peace march" on Saturday, parading with trucks mounted with rockets. One group of fighters wore mock-explosive belts while another group carried improvised bombs. "(These fighters) are ready to sacrifice their souls and blood for the sake of defending Iraq and its generous people," a man on a podium said as the fighters marched by.
Some Baghdad residents are seeking refuge in the country's Kurdish north, which is relatively secure. "All my stuff is in boxes. I sold my apartment. I sold all my furniture," said a 54-year old restaurant manager who had just landed in the Kurdish capital Arbil. The number of flights from Baghdad to Arbil has tripled, yet tickets are sold out and trading at a premium on the black market.
But most Baghdad residents have nowhere to go and are staying put, waiting for the next wave of violence in a city where peace is barely a memory. In an Ottoman fort, now a public park on the bank of the Tigris, a collective of poets took it in turns to stand on a podium and read verses aloud.
Many focused on the conflict. One poet read out: "It's time for people to rest, "Grief has begotten nothing but grief, "When is it our time to rejoice?"