Over the last few weeks the excitement in Kabul has been palpable. Driving about the city, one saw at every junction huge billboards extolling the virtues of Zalmal Rassoul, Abdullah Abdullah or Ashraf Ghani.
There have been virtually no other topics of conversation. Every night the news programmes of Tolo, Ariana, National, Shamshad and a dozen of the other television channels available in the city have broadcast election rallies, conducted and given the results of opinion polls, or covered debates in their studios.
The resident comics on Tolo's hugely popular satirical programme 'Zange Khatar' (Alarm Bell) have had a field day, purporting to represent absurd political parties with insane policies, all very reminiscent of Britain's 'Monster Raving Loonie Party' .
To a western resident of Kabul it has all been comfortably familiar, except for one thing - a very big thing. The Taliban had threatened a series of spectacular attacks to disrupt the elections.
Their message was simple. Invaders had imposed what they call democracy to give a spurious legitimacy to what could never be more than a puppet government. Anyone who participated in this illegitimate process was at best a collaborator, at worst a traitor, and deserved to suffer a traitor's fate.
Memories of the aftermath of the 2009 election are still very strong. Some people who voted, particularly in Helmand and the south east were killed out-right, others had their purple dyed index fingers cut off. In the days before the election, excitement mixed with fear. It was clear that many people were hedging their bets - they would make up their minds whether or not to go to the polling station on election-day.
The election of 2009 wasn't only remembered for the security failures. People had been killed and maimed for supporting a process marred by an embarrassingly high level of fraud, with over one million votes declared invalid. The level of participation, too, had been desperately disappointing, with only 4.6million voting, about 31.4% of the electorate. In Helmand Province, for example, only 50,000 had voted, a number later increased to 150,000 in an utterly spurious inflation.
The fear that everyone harboured in the weeks before election-day was that if 2014 went the same way as 2009 the ISAF mission would have ended in ignominious failure. The Taliban did their best to make sure this would be the case.
The attack on the Sarena Hotel was the opening shot in the campaign. It was an atrocity - indeed, too much of an atrocity for many Afghans to stomach. It is one thing gunning down politicians and ISAF soldiers, quite another shooting down Afghan women and children. Instead of being regarded as martyrs, there was widespread condemnation which soon turned to contempt.
One story that emerged from the attack was that gunmen had opened up on a group of Afghan senators, who instead of hiding under tables had picked up plates, glasses and chairs, anything they could lay their hands on, and had thrown them at the assailants, forcing them to withdraw hurriedly and look for softer targets.
Then came the attack on the Independent Electoral Commission. Wearing sky-blue burqas, five insurgents entered an adjoining building, fired a few rockets, loosed off a few magazines, and were promptly killed by the security forces without having inflicted a single casualty. Rather than being regarded as martyrs the fact that they had worn a women's garment resulted in widespread derision, with jokes about the propriety of entering paradise wearing lip-stick and eye-liner.
It was beginning to dawn on more than a few that if was the best the Taliban could do we didn't have too much too worry about. These clowns were certainly not top draw - very much the B or even C teams - though maybe the A teams were all dead. After all, it's very difficult to find experienced suicide bombers.
There was an alternative theory, that the Taliban were saving up their best teams for a series of truly spectacular attacks on the day of the election. By Friday lunchtime the city was in lockdown, as was much of the rest of the country, with over 400,000 security personnel deployed and on high alert. Electioneering was supposed to have stopped on the Thursday evening, but one could still hear the blare of loud speakers, as politicians made their last appeals to the electorate. One of the most endearing characteristics of Afghans is their willingness to ignore regulations which they find restrictive.
This morning dawned grey, with low clouds swirling around the nearby hills, and a moderately heavy rain falling. From my vantage point overlooking one of the polling stations in an outlying suburb of the city I watched two queues form at least an hour before voting was scheduled to begin, one of men, which was already beginning to get quite long, and a rather shorter one which, from the headscarves everyone was wearing, consisted of women.
I was in my bedroom, dry and comfortable, and keeping one eye out the window, and kept channel hopping to follow the live coverage which many of the stations were broadcasting. All transmitted scenes similar to the one I was watching, of queues forming early, all of which were unexpectedly long, some extending around blocks by the time the polling stations opened. It was now raining very heavily, but as the day wore on more and more people came out to vote, as though the presence of so many had given them the courage to defy the Taliban.
By 15.00 reports were coming in from several stations that they were running out of ballot papers. Soon afterwards the IEC announced that the polling stations would stay open until 17.00, and finally, that the deadline had been extended yet gain so that all those still queuing would be allowed to vote.
The mood in Kabul, at least in the part I could actually see, appeared to be triumphant - indeed, euphoric - and reports from elsewhere in the country confirmed that this mood was not simply confined to the capital.
At about 20.00 the first preliminary figures were released. At least seven million had voted, more than 58% of the electorate, which was nearly twice the turnout in 2009. It was roughly the proportion of those who vote in US presidential or British general elections.
Moreover, 35% of those who had voted were women, more then 2.5million. When one considers the security situation, the threats made by the Taliban, and the miserable weather, the result has been quite phenomenal. There is something immensely humbling to see groups of people holding up their dyed fingers, as much as to say 'Suck to you, Taliban'!
It isn't over yet - not by a long chalk. There will be regional differences, a high voter turn-out in Kabul and the north, and a lower one in the south and the east. And there are sure to be allegations of corruption, though I doubt if they will be more than a pale reflection of the allegations made in the wake of the 2009 elections. For those of us who have come to love Afghanistan and its people, it has been a wonderful day.
Tonight there is a sense that the country has turned a corner - a new president who will sign the BSA, a continuation of developmental aid and training programmes, and Afghanistan has more than a fighting chance.
And how are the Taliban feeling tonight? Sick, I hope - very sick. Because tonight it looks as though the high price America and its allies have had to pay in blood and treasure may have been worth it, after all.