The US occupation of Iraq is still in its early stages. It is ludicrously premature to call it a failure, as some critics already do. Assuming that the US and Britain keep their nerve in the face of growing guerrilla attacks, there is little doubt that they can still make good on George W. Bush's pledge, delivered in a speech on Tuesday, that "there will be no return to tyranny in Iraq" and that "those who threaten the order and stability of that country will face ruin, just as surely as the regime they once served".
But even if things ultimately work out well - and the odds are that they will - it is not too soon to ask what went wrong. This is not to cast blame but to do better in Iraq - and in the next country that needs to be rebuilt. Liberia, perhaps.
There is no question that the US government was ill-prepared for the aftermath of a war well fought. Many facilities, such as electrical transformers and oil pumping stations that had been meticulously spared by the air campaign, were destroyed by looters and saboteurs. Many members of the old regime escaped and have come back to haunt the occupying authorities. Both problems have set the reconstruction process back.
The administration implicitly conceded that something was amiss early on when it sacked Jay Garner, a mild-mannered former general, and replaced him as viceroy with the tough-talking Paul Bremer. Mr Garner complained that his outfit - the Pentagon's Office of Reconstruction and Humanitarian Assistance - had been hastily assembled and given neither the time nor the resources to prepare for running a country of 24m people. Mr Garner had only two months to plan and no more than 200 staffers to work with.
The lack of preparation is astounding not only because the Iraq invasion had been long foreseen but also because America and its allies have run so many similar nation-building exercises in recent years: Somalia, Haiti, Bosnia, East Timor, Kosovo, Afghanistan. Yet there has been little attempt to apply the lessons of those places in Iraq.
Part of the explanation may be the Bush administration's habitual - and deeply counter-productive - distrust of "nation-building", which many on the right wrongly view as liberal muddle-headedness. But even those in government who realise that the US has an interest in bringing stability to war-ravaged lands were handicapped by the lack of an institutional framework for dealing with the issue.
Take law enforcement. Robert Perito, a former US foreign service officer who has worked in Bosnia, East Timor and Kosovo, says there is a critical need to create a federal constabulary to monitor law and order in postwar environments. The US army, most of whose military police are in the reserves, is ill-prepared for the task. It does not have enough crowd control equipment, for instance, so troops end up firing into unruly mobs. A federal constabulary along the lines of the Italian carabinieri could take charge of crowd control, anti-terrorist operations and other functions until international civil police arrive and a local police force can be set up.
Along with a constabulary should come judges, prison administrators and an interim legal code that they could enforce. Without a functioning court system, many criminals will end up being released after arrest, as in Bosnia and Kosovo.
Important as law enforcement is - and it is crucial - other things also need to be done to get a country such as Iraq back on its feet. Schools need to reopen, an army should be trained, sewage must be treated, electricity restored, mayors selected - and so on and on. The US army is currently doing most of these tasks. But its civil affairs units are stretched thin. In many cases the job has defaulted to a 22-year-old second lieutenant who has been trained to kill people, not to help them run a factory. He is probably doing a decent job, all things considered, but he would be the first to say he is not the best person for the position.
The irony is that there is no shortage of US experts in all these fields, in and out of government, many of them veterans of prior peacekeeping operations. What is lacking is a central office that can marshal their expertise. We need to create a colonial office - fast.
Of course, it cannot be called that. It needs an anodyne euphemism such as Office of Reconstruction and Humanitarian Assistance. But it should take its inspiration, if not its name, from the old British Colonial Office and India Office. Together, these two institutions ran large swaths of the world with a handful of bright, honest, industrious civil servants. They had an enormous impact, given the small numbers involved; there were seldom more than 1,000 members of the Indian civil service to administer hundreds of millions of Indians. Like its British predecessors, the US colonial service needs to be an elite civilian agency that can call on forces for assistance where appropriate.
The US does not need or want a formal empire on the British model. But it desperately needs to win the peace in places such as Afghanistan and Iraq - where the British, as it happens, had a lot of experience of their own. They had their share of setbacks but they could not have accomplished as much as they did without their top imperial civil services. America needs to create one of its own, before its hard-won military gains turn to dust.
The writer, Olin senior fellow at the Council on Foreign Relations, is author of The Savage Wars of Peace: Small Wars and the Rise of American Power.