By Jim Muir
BBC News, Baghdad
Is Iraq getting better? The statistics say so, across the board.
US forces have recruited thousands of young Iraqi men for local policing
Over the past three months, there has been a sharp and sustained drop in all forms of violence. The figures for dead and wounded, military and civilian, have also greatly improved.
All across Baghdad, which has seen the worst of the violence, streets are springing back to life. Shops and restaurants which closed down are back in business.
People walk in crowded streets in the evening, when just a few months ago they would have been huddled behind locked doors in their homes.
Everybody agrees that things are much better.
But is the improvement only skin deep? And will it last once the American troops, whose "surge" has clearly made a difference, begin to scale down?
In the past few days, two events have underlined big changes that have happened in recent months on both the Sunni and Shia sides of the Iraqi equation.
Reign of terror
The Mehdi Army's influence is now much weaker
On Thursday, in a crowded public hall in the mainly Shia city of Karbala, south of Baghdad, the local police chief, Brig-Gen Ra'id Shaker Jawdat, bitterly denounced the Mehdi Army militia, accusing it of presiding over a four-year reign of terror there.
It was an extraordinary occasion. One by one, men and women stood up and screamed abuse at the militia, blaming it for killing and torturing their loved ones.
It could not have happened a few months ago, when the Mehdi Army - the military wing of the movement headed by the militant young Shia cleric, Moqtada Sadr - was the real power in the streets of Karbala.
A few days later, Moqtada Sadr ordered his followers to halt all forms of military action nationwide, even in self-defence.
That was a turning-point in Baghdad too. The number of bodies being found daily, dumped randomly in the city after being abducted, tortured and killed in sectarian reprisals, dropped from dozens a day to less than a handful.
Scenes of rejoicing
On Friday, near Samarra to the north of Baghdad, fighters from a Sunni faction called the Islamic Army in Iraq (IAI) launched a surprise attack on positions held by al-Qaeda in the area.
Police said the IAI killed 18 al-Qaeda militants and captured 16 others.
Shortly afterwards, another Sunni group known as the 1920 Revolution Brigades launched a similar operation against al-Qaeda at al-Buhriz in Diyala province, also north of Baghdad.
They captured 60 al-Qaeda suspects and handed them over to the Iraqi army, amidst scenes of rejoicing in the town's streets.
These also were events that simply could not have happened until recently.
Both the IAI and the 1920 Revolution Brigades used to be insurgent groups themselves, fighting alongside al-Qaeda against the multinational forces and Iraqi government troops.
Blow to militants
Groups such as al-Sahwa are influential in Baghdad
Now, starting with the western al-Anbar province and spreading east to Baghdad and mainly Sunni areas to the north, there has been a gathering trend whereby Sunni tribes and nationalist groups have turned against al-Qaeda as their primary enemy.
The Americans have seized on the tactic, encouraging tribal and other Sunnis to form regional associations, such as al-Sahwa (The Awakening), as a vehicle for getting government and coalition support.
In the provinces, tribesmen joining up are paid $600 a month to protect their own areas against al-Qaeda.
The trend has spread deep into mainly Sunni districts of Baghdad, where al-Sahwa has filled the gap left by al-Qaeda.
American forces have recruited thousands of young men, who are given uniforms and $300 a month to act as neighbourhood guards (known in US military jargon as Concerned Local Citizens, or CLCs).
They apply in droves, as there are no other jobs in town.
US forces have moved into virtually every area and set up fixed positions. They have local mobile phone numbers emblazoned on their vehicles for the CLCs to call if they run into trouble.
This, combined with the way in which the US troop surge has proactively tackled any al-Qaeda presence it can detect, has dealt a massive blow to the Sunni militants.
The Iraqi Prime Minister, Nouri Maliki, is now openly claiming victory against al-Qaeda and its affiliates.
US military leaders are more cautious.
"There is no part of Baghdad in which al-Qaeda has a stronghold any more," said Brig-Gen Joseph Fil, commander of the Multinational Forces in Baghdad.
"But Baghdad is a dangerous place. Al-Qaeda, although on the ropes, is not finished by any means. They could come back swinging if they're allowed to, in fact, we've seen it," he added.
Bomb attacks rarer
Markets in Baghdad are said to be booming now security is better
But there is no doubt that it has lost out massively in Baghdad.
One resident of the mainly-Sunni area of Dora, in the south of the capital, summed it up.
"The Islamic State in Iraq (the umbrella name adopted by al-Qaeda groups) used to control most of the area like a phantom presence. I know Shia shopkeepers who were shot dead in their shops."
"They put up notices warning people to wear strict Islamic dress. Everybody was frightened. When we called the police to report bodies on the street, they said it was a no-go area and they couldn't come."
"Now, the Islamic State elements have disappeared. Shops have reopened. My daughter can walk to school without wearing a headscarf. Some Shias who fled have come back. And most important of all, we haven't heard of anybody being killed since July."
The setback dealt to al-Qaeda and affiliates has had a knock-on effect in the Shia communities too.
The often massive, indiscriminate bomb attacks for which they were blamed, and which used to hit Shia areas on a daily basis, have now become a rarity.
The huge drop in bomb attacks has removed one of the main raisons d'etre for the Mehdi Army, the most active Shia militia in Baghdad.
Since neither the state nor the coalition forces had been able to stop the bomb attacks before, the Mehdi Army could pose as the only saviour of the Shias from slaughter at the hands of fanatical Sunni extremists.
"They were on the streets every day, with guns, controlling and checking people," said a Shia resident.
"When there were attacks on Shia shrines, such as Samarra last year, they killed many Sunnis in the area in revenge."
"Now, they are much weaker. Many of the leaders have been arrested or killed by the Americans. Others have fled. Some are still around, but they are keeping a low profile."
The US military admit that around 13% of Baghdad - mainly parts of the huge eastern Shia suburbs, Sadr City, where the Mehdi Army used to hold undisputed sway - remain to be brought fully under control.
But the decision by Moqtada Sadr to order a freeze on militia action has removed political cover from Shia militants who resist, and who are now regarded as "rogue elements".
"When we go to the [Shia-dominated] Iraqi government with lists of militia leaders we want to get, they're very supportive," said Baghdad coalition forces commander Gen Fil.
One problem is that the Americans and the Iraqi government cannot use the al-Sahwa ploy of recruiting local youths in Shia areas to mount guard against the Mehdi Army. It simply would not work.
Unlike al-Qaeda's situation in the Sunni areas, Shia leaders such as Moqtada al-Sadr enjoy considerable popular support among the Shia, even if elements of the militia have got well out of hand.
Some residents of Shia neighbourhoods are optimistic that another six months of sustained effort might see the militias off for good. Others are not so sure.
The US troop surge led to a sharp drop in US and Iraqi casualties
The huge problem in both Sunni and Shia areas is that continued success is desperately dependent on a continuing American presence, while the US is planning to start drawing down its forces next year.
"In my Sunni area, people are happy to see their sons defending the neighbourhood in an official way, because it's under an American umbrella," said one Sunni.
"That means they're not afraid that the Mehdi Army or another Shia militia will come through the lines and kill us."
The Iraqi Army and police have frequently been accused of either colluding with or turning a blind eye to the Shia militias, some of which have operated openly under the guise of official security formations.
Especially among the Sunnis, there is little popular confidence in the Iraqi army, and much less, if any at all, in the police.
"Forget about the Iraqi police, they're either Mehdi Army in uniform or professional thieves, or both," said a Sunni living in a largely-Shia area.
"It bothers me that this whole thing is so US-dependent. It's temporary security. The Mehdi Army are just biding their time, and waiting to come back out and get back to business, extorting money from people, forcing them out of their homes and then renting them out. It's big business."
"I'm not optimistic about the surge, because of the sympathies of the Iraqi police and army towards the Mehdi Army," said a Shia from south-east Baghdad.
"It's an ironic situation, where we need federalism, but we also need a dictator, a strong powerful government. If we don't get the militia out, there will be no solution."
Purging the security forces of militia influence and sympathies is a huge task that needs a strong, neutral political will and a sustained effort.
There are many other massive challenges that will affect the outcome of the current struggle.
Need for reconstruction
Everybody agrees that military and security measures on their own can only go so far if not buttressed by economic, social and political progress.
The Americans and Iraqi government are well aware of the need to follow up with services - electricity and water supplies are still sporadic - and job-creation schemes if they are to hold the ground they are clearing.
Prime Minister Nouri Maliki has said that next year will be the year of services and reconstruction. At this stage, Iraqis are looking for performance and delivery, not promises and fine words.
One of the main stated objectives of the US troop surge was to clear a space for the Iraqi politicians to enact nation-building legislation and pursue national reconciliation as the cornerstone of the New Iraq.
But virtually none of the key pieces of required legislation has yet been passed by a fractious Iraqi parliament which has been wracked by factional disputes.
There is still no shared and agreed vision of Iraq's future. Kurds and some Shias want a loose, federal arrangement, while Sunnis and some others want a stronger, more centralised state.
It matters. To which Iraq are people signing up with the security forces swearing allegiance?
In the absence of progress at the top, the Americans are counting on developments and reconciliations at grass-roots levels, a "bottom-to-top" approach. How far that process can go at that level alone is an unanswered question.
Despite the progress in the security arena, the story is far from over. The casualty figures are down, but people are still being killed every day.
While things have improved greatly in Baghdad, inter-Shia power struggles in the south of the country remain intense, and insurgent activity continues strong around Mosul and Kirkuk in the north.
Nobody can underestimate the magnitude of the task ahead. And with the clock for US troop withdrawals ticking ever more loudly in Washington, it is a race against time.
But there can be no denying that many Iraqis, especially in Baghdad, are more optimistic now than they would have dared believe possible a year ago.