A major militant offensive launched on Monday, spearheaded by the Islamic State of Iraq and the Levant (ISIL) group but also involving supporters of executed dictator Saddam Hussein, has overrun a large chunk of northern and north-central Iraq.
The advance swept to within less than 100 kilometres (60 miles) of the capital, raising fears among residents that the city itself would be next, though militants have since been pushed back by security forces in areas farther north, making an assault on Baghdad appear less likely.
ISIL spokesman Abu Mohammed al-Adnani has vowed its fighters would press on to Baghdad and Karbala, a city southwest of the capital that is considered one of the holiest sites in Shiite Islam.
Top Shiite cleric Grand Ayatollah Ali al-Sistani on Friday urged Iraqis to take up arms against the Sunni militants.
Trucks carrying hundreds of volunteers were among a large number of vehicles passing through the key main checkpoint north of Baghdad, as security forces carried out spot checks.
The volunteers sang patriotic songs as they were driven to a nearby training centre.
Security forces performed poorly when the militant onslaught was unleashed, but they now appear to be recovering from the initial shock and have begun to regain ground.
The volunteers sang patriotic songs
They are regrouping despite scenes of disarray in the early days of the offensive, when soldiers shed their uniforms for civilian clothes and abandoned weapons and other equipment.
And they have retaken areas north of the capital that were among the closest militants got to Baghdad, officers said.
Bolstered by militiamen
Regular security forces are bolstered by militiamen in preparing to defend the capital.
"Our forces stand as one rank beside the army and the police," said Hussein al-Tamimi, a local leader of the Sahwa militia forces, which fought alongside American troops against militants in previous years.
"Where are they?" he asked of the militants.
"We are waiting for them and looking for them. We want them to come so we can finish them."
Signup to our newsletter and follow us on Facebook and Twitter!
Dhia Ali al-Tamimi, a local tribal leader, also spoke out in support of the security forces, telling AFP that "everyone must protect the land and the state".
"Life is completely normal in our areas and attacks by these terrorists don't scare us," he said.
Inside Baghdad itself, security forces have also set up new checkpoints, joining a slew of others.
Brigadier General Saad Maan has told AFP that "we put in place a new plan to protect Baghdad".
It "consists of intensifying the deployment of forces, and increasing intelligence efforts and the use of technology such as (observation) balloons and cameras and other equipment," Maan said.
He also said coordination between the various security forces had been increased.
Ihsan al-Shammari, a politics professor at Baghdad University, said he does not expect the militants to reach Baghdad, and that "their end will be far from the capital".
But if they did reach Baghdad, it would devolve into street-to-street fighting, Shammari added.
Inside the capital, life is still relatively normal in the Kadhimiyah area, the city's northernmost area and home to a revered Shiite shrine visited by hundreds of thousands of people every year.
Kadhimiyah shop-owner Abu Khodr was defiant, saying that "standing up to terrorism is a national duty for everyone in the world, not just in Iraq".
"We don't fear them at all," he said of the militants. "Do we fear the enemies of God?"
A confident army Colonel Abduljabbar al-Assadi, inspecting the new defensive positions north of Baghdad, said: "Our forces are ready for any emergency."
Assadi said the checkpoint had already been attacked twice. In one attack, his arm was broken.
"Despite that, I refused to leave the checkpoint, and I will not abandon it," he said.