In Libya effective rebel military control is visibly outfacing the establishment of political stability. There are checkpoints everywhere in Tripoli and along the coast road east and west. Security is surprisingly good, given that the war in these heavily populated areas has only just ended. Even the rattle of gunfire from jubilant rebels shooting into the air is subsiding.
The Transitional National Council members have been slow to get to Tripoli and slower still to take charge when they do arrive. Abdel-Rahman el-Keib, a member of the TNC, told me that he thought the rebel politicians, for all their previous vocal confidence in victory, were "disorganised because they did not think that Gaddafi's collapse would be so quick. His forces were not so strong as we thought."
Divisions that did not matter too much in Benghazi suddenly count when it comes to who gets what top job in Tripoli. Already there is a struggle over who will have control of Libya's unfrozen billions of dollars. Yesterday was also the deadline originally given by the Obeidi tribal leaders for the TNC to deal with those of its members responsible for the killing of the army commander Abdul Fattah Younes on 29 July. They have threatened that if the TNC does not act they will exact vengeance themselves.
The present calm may be a little deceptive. Many Libyans are staying in their houses because they think it too dangerous to go out and, above all, there is a desperate shortage of petrol. Even closed petrol stations have cars queuing day and night in the hope of a delivery. A few shops have reopened, but mostly in the centre of well-secured districts such as Souq al-Jumaa. Great numbers of Libyans, particularly from wealthy areas such as Hai Alandus, are still in Tunisia or other countries where they took refuge.
Even so, Col Gaddafi's threats of fighting "a long war" sound empty, though they make the Military Council, in command of all the militias, feel nervous. Its chairman, Abdelhakim Belhaj, told me that he would not be surprised if there were some sniping and bombing by pro-Gaddafi cells. In the present hyper-sensitive mood in Tripoli, small attacks showing that the old regime is not entirely dead would have a disproportionate impact on confidence. Militiamen have become nervous of any vehicle approaching the two hotels housing many TNC members and media.
People in Tripoli are astonished, as if they cannot entirely believe their luck, that the six-month war ended so quickly and decisively. Local militia commanders were also surprised by this. Even in an area like Abu Salim, supposedly full of Gaddafi supporters, there was little fighting. Khalid, an accountant in a local bank carrying an assault rifle, said: "We thought they were strong, but the fighting only went on for a couple of hours. A lot of people switched sides at the last moment." He and other militiamen suspect that pro-Gaddafi fighters have retreated to farms on the edge of Abu Salim and are planning an operation to root them out.
Almost everybody in Tripoli now claims to have been working openly or secretly on the rebel side. Such unlikely claims have probably been made in every captured city down the ages. But all the evidence is that by the time the rebels broke through at Zawiyah in August and, to their surprise, found the road to the capital open and undefended, the morale of the pro-Gaddafi forces had collapsed.
One former soldier described how he had abandoned his tank at Zawiyah when ordered to retreat in the face of a rebel assault from the Nafusa mountains, an uprising in Zawiyah itself, and Nato planes relentlessly smashing pro-Gaddafi defensive positions. He simply decided that the game was up and there was no point in waiting to be incinerated inside his tank. He took off his uniform and ran.
Inside Tripoli, regime supporters similarly concluded that there was no reason to die for a doomed cause. Issam, an Islamist truck owner in charge of a district in Souq al-Jumaa, said his men had few weapons at first, but obtained them by "going house to house asking pro-Gaddafi people to hand over their arms and stay at home." Nobody refused. Khalid in Abu Salim said he thought the turning point in the war had come when Gaddafi failed to capture Misrata in early summer and Nato intensified the bombing. After that, Gaddafi's men were on the retreat and it was easy to pick the ultimate winner.
Gaddafi was defeated by a broad coalition of enemies which ranged from human rights lawyers to former jihadi militants, people who had spent years in jail and members of the regime who had put them there. Men like Mr Belhaj, founder of the Islamist Libyan Islamic Fighting Group, who says he was tortured by the CIA in Thailand in 2004 and then handed back to Gaddafi to be tortured again, found themselves fighting in alliance with Nato.
The crucial question now in Libya is whether this coalition will stick together when it comes to creating the democratic institutions of a new state. There is bound to be a power struggle, but this does not matter so long as the rules of the game are first agreed. A milestone on the road to civil war in Iraq in 2005 was the holding of an election even though the Sunni community had not agreed to the rules. A further destabilising factor in struggles for power in oil states such as Iraq and Libya is that anybody who can gain authority, even for a short period, stands to make a great deal of money.
If Gaddafi were killed or captured it would remove a rallying point for the old regime, but it would also eliminate a convenient focus for opposition. He was in many ways a handy enemy to have on the battlefield. Once Nato airpower was engaged, he was always going to lose, since France and Britain were not likely to allow themselves to be humiliated by his survival in power. He and his commanders employed few new tactics during the war, such as placing remotely detonated mines beside the roads. The use of IEDs, which made Iraq's roads so lethal for US troops, would have devastated the rebel columns of un-armoured pick-ups.
Politically, the TNC looks fragile, disunited and unready to take over government. By way of contrast, the local committees that secure the streets of Tripoli appear highly capable. Though there are shortages of water, food, fuel and almost everything else in the shops, the committees say they have built up enough stocks over the past six months to fend off a humanitarian crisis. But the political leadership looks weak, and it is unlikely that militias will tamely dissolve themselves. The new Libyan state may not be able to withstand a lot of pressure, but, on the other hand, unlike Iraq and Afghanistan, it may not have to.