The weekend's elections in Iraq were a huge success for the Iraqi people. The remarkably peaceful day of voting on Saturday - and the interim results - give good reason to hope Iraq really is on the way to building a decent society.

These provincial elections were held in 14 of the country's 18 provinces (Kurdistan will hold separate elections, and the disputed oil-rich city of Kirkuk was deemed "too hard" at present). This was the first post-Saddam election that the Iraqis handled themselves. Iraqi soldiers protected the polling stations. It was also the first election to have international observers in all 712 constituencies. In 2005 terrorist attacks made that too dangerous. Then, more than 200 candidates were killed - this time, eight died. There were 14,412 candidates standing for office, an impressive number.

This was also the first election in which there was no boycott on ethnic or sectarian grounds. There was an enormous spread of views represented on the ballot papers - Iraq is the only Arab country which offers almost everyone, including Trotskyites and monarchists, the freedom to stand for election.

The turnout, 51%, was less than some predicted but importantly it included many Sunnis who had boycotted the last elections in 2005. Turnout in some of the Sunni areas was as high as 60%. The hope is that these Sunnis have turned from the methods of al-Qaida, which dominated the early post-Saddam years, to the political process.

The peaceful polling was remarkable and so were the results. All the Islamic parties lost ground, especially that associated with the so-called "Shia firebrand", Moqtada al-Sadr, whose share of the vote went down from 11% to 3%. The principal Sunni Islamic party, the Islamic Party of Iraq, was wiped out.

The only Islamic party to gain ground was the Dawa party of the Shia prime minister Nouri al-Maliki - and even that party dropped the word Islamic from its name. The power of Maliki, who has emerged a stronger leader than expected, is further enhanced by these elections. Now no Islamic parties will be able to control any provinces on their own. The election is thus a big defeat for Iran which had hoped that Shia religious parties would control the south and enable Iran to turn them into a mini Shia republic.

Instead, a new generation of Iraqi politicians is coming forward. Many of them are young and secular. They have lived always in Iraq, not in exile; they are Iraqis with local roots first and foremost - they are not pan-Arabs or pan-Islamists. Nor do they have connections to the US.

Iraq's polity is still fragile. Parliamentary elections later this year will be another test of whether the horrific inter-Islamic violence of recent years is over. The country is still far from united and its infrastructure still needs massive investment. But there are now real grounds to hope that Iraqis are finally on track to creating a far more decent society than they have ever had. This would never have been possible without the US-led overthrow of the psychotic Saddam family.

There were lamentable failures in the subsequent US occupation, which allowed the rise of the hideous sectarian violence that threatened to tear the country to pieces. But in the last two years the "surge" of US troops under General David Petraeus appears to have destroyed much of the terrorists' infrastructure and support. Now, as US troops begin their phased withdrawal, the new American-trained Iraqi army is defending the country against Islamist violence.

There will be further setbacks. But who knows, Iraq may yet even become a model for democratic change in other Arab countries. If so, who deserves some credit? The much maligned President Bush. And Tony Blair.

• William Shawcross's most recent book is Allies: the United States, Britain, Europe and the War in Iraq

williamshawcross.com