The battle for Basra, which came to a halt on Sunday, was a disaster for everyone except its intended losers. Tens of thousands of families were trapped in their homes for a week, their electricity, mobile phones and water cut off. The number of deaths is unknown, but is probably several hundred.

Iraq's prime minister, Nouri al-Maliki - who ordered the assault and put his prestige on the line by supervising it in person - has emerged with his authority severely weakened. His army and police took a battering and failed to capture any ground, with several commanders and units going over to the Sadrist militias they were meant to be defeating. And the Bush administration's effort to portray Iraq as a place that is gradually calming down thanks to the "surge" of an extra 30,000 US troops looks far less convincing to an increasingly sceptical US public.

Finally, there is the blow to Britain's remaining forces stuck at Basra airport. Some 1,600 had been hoping to leave Iraq this spring. Des Browne's Commons statement this week shows that a few of them played a bigger role in the Basra fighting than was at first realised. As well as mounting surveillance and artillery strikes, British troops were deployed to rescue Iraqi units from militia counterattacks. Now the government feels it has to show solidarity with Maliki and Bush by delaying another troop reduction, even though only a limited number were needed last week. British forces are held hostage to save the face of politicians once again.

Meanwhile, Moqtada al-Sadr, the target of the assault, comes out of the crisis strengthened. His militiamen gave no ground and, by declaring a ceasefire that has successfully held since Sunday, Sadr has demonstrated his authority and the discipline of his men. Their tactics are often brutal and some of his commanders little more than thugs or warlords, but they obey their political boss.

Big questions remain over the backroom negotiations that ended the fighting. In his ceasefire announcement Sadr called for an end to the Maliki government's campaign of arresting local Sadr representatives in Baghdad and other cities. This has been going on for months without a Sadr response. Sadr also asked for the release of those being held, an estimated two thousand. What is not clear is whether the government conceded these points during pre-ceasefire talks. If so, then Sadr's appeal was a generous cover to allow the government not to look as though it had already capitulated. Much will depend on whether Maliki fulfils the promises he made. Otherwise fighting may resume, this time with Sadr taking the initiative.

The US role is the other main unknown. General David Petraeus, the US commander in Iraq, and the Bush administration's civilian officials supported the arrests of Sadr's people. They have long worked with Maliki and Sadr's main political rivals, the Islamic Supreme Council of Iraq (formerly the Supreme Council for the Islamic Revolution in Iraq), to weaken the movement. Although the fighting in Basra was led by the Iraqi national army, many of its units are made up of troops of Isci's fighting wing, the Badr organisation.

President Bush described last week's fighting as a "positive moment in the development of a sovereign nation that is willing to take on elements that believe they are beyond the law". In reality, it amounted to US support for the promotion of a Shia civil war. There are depressing similarities with US policy in Palestine, where the US is arming and financing Mahmoud Abbas's Fatah movement against Hamas instead of working for Palestinian unity.

US officials say that Iran is behind the Sadr movement, a charge that could equally be made about Isci, whose leaders spent decades exiled in Tehran during the Saddam Hussein years. In fact, Sadr's real sin in Washington's eyes is that, of all the Shia movements, his is the one that has most consistently opposed the US occupation and called for a timetable for US troops to leave Iraq.

How far was the US responsible for last week's assault? When Iraqi government forces became bogged down after the initial attacks, US officials were quick to brief American journalists that they had not been fully consulted in advance. Certainly the government's poor performance and the flare-up in fighting have made things harder for Petraeus and the US ambassador, Ryan Crocker, when they brief Congress next week on the latest results of the surge. But it is hard to believe that the Iraqi army could have undertaken such a major offensive without American cooperation, since they needed American, and British, surveillance and air support.

The most likely explanation is that the Americans approved the assault, confidently expecting it would succeed within a few days. The hardline US vice-president, Dick Cheney, was in Baghdad two weeks earlier and may well have urged Maliki to go ahead. They hoped for a triumph to boast about in Congress. Now they must explain a disaster.

Even before the Basra assault, scepticism about the surge was mounting in the US. A majority of the American public wants a timetable for a US withdrawal, and the two Democratic contenders are still firm on the point, arguing that the surge has not resolved Iraq's underlying problems. Senators Obama and Clinton are vague on some key issues, not least their intention to keep "residual forces" in or around Iraq even if most combat troops leave. But they have not been taken in by the surge.

Deploying an extra 30,000 troops was not the main factor in lessening sectarian attacks - the measure used to define the surge's success. More significant was the uprising by Iraqi Sunnis against al-Qaida, which has put foreign jihadis on the defensive and made it harder for them to attack Shias. The ceasefire announced by Sadr last August had a major effect in reducing revenge attacks by his followers on Sunni civilians.

That is why last week's assault on Basra was particularly foolish. Instead of using Sadr's original ceasefire constructively to engage him in political dialogue, American officials joined Maliki in trying to break Sadr's movement. The lesson of the past few days must be that this policy is doomed. Sadr is a major player who cannot be marginalised or defeated. He has widespread popular support, not just because of his socially conservative Islamist message, but because of his nationalist credentials. These have been strengthened by last week's failed assault. It should not be repeated.

j.steele@theguardian.com