The incumbent, President Mahinda Rajapaksa, is engaged in a desperate fight for his political life in an election which just a few months ago seemed to be his for the taking.
It should all have been so different. Rajapaksa, previously prime minister of Sri Lanka, became president in 2005 in an election in which he won just over 50 per cent of the votes.
But within a couple of years of taking power he embarked on a process which was conventionally deemed impossible. He set out to militarily defeat the LTTE, or Tamil Tigers, the rebel force which for the best part of a quarter of a century had been fighting for an independent homeland for the Tamil people of the north and east of the island, in a bid to redress decades of anti-Tamil discrimination.
The Tigers were themselves a brutal force, prepared to use child soldiers and terror tactics including the suicide bombing of civilian targets.
But few people were ready for what happened next.
Rejecting the terms of a much-broken 2002 peace deal, the government launched a massive offensive against the Tigers and their de facto state of Tamil Eelam. By the first few months of 2009, with the Tigers in hopeless retreat, the government declared a series of what they called "no fire zones", into which they encouraged as many as 400,000 Tamil civilians to gather "for their own safety".
Government forces then relentlessly shelled these zones and, as a later UN report concluded, systematically denied them food and humanitarian supplies. The UN estimates that there were "as many as 40,000 civilian deaths in a matter of weeks, most as a result of government shelling. There was also a World Bank estimate that 100,000 civilians were missing after the war.
In the last few days, in horrific scenes first exposed by Channel 4 News, dozens of Tiger prisoners were stripped, blindfolded and executed.
But in the aftermath of what was seen by Sri Lanka's Sinhala majority as an historic victory, there were few concerns about how the war had ended. However brutal the war's end and the repression that has followed in the north of the country, the bitter war was ended and the killing stopped.
What didn't stop, according to multiple human rights organisations and relatives, were the disappearances of government critics, dissidents, and Tamils - the notorious white vans allegedly prowling night time districts and bundling people into the back became symbolic of the Rajapaksa's grip.
In 2010 President Rajapaksa, by now nothing less than a national hero, was re-elected with an increased majority. But over the next couple of years things were starting to unravel. As the truth slowly began to emerge about events at the end of the war, there were growing international calls for some kind of inquiry - calls which resulted in the creation of a UN-mandated inquiry last March, due to report back to the UN Human Rights Council in March this year.
An unassailable hero?
But until just a few months ago Rajapaksa seemed unassailable in Sri Lanka. Riding a continuing tide of Sinhala-nationalistic rhetoric as the man who won the war, the growing concerns over the widespread corruption and nepotism of his rule and his assaults on judicial and media freedom appeared initially to hardly dent his popularity.
Such was the apparent culture of impunity that while he changed the constitution so he could stand for a third term and had immunity from prosecution, on the streets violent racist mobs led by hard-line Buddhist monks seemed free to turn their ire on the island's other minorities, the Muslims and Christians, without serious challenge. At least four Muslims died in their riots, to little apparent concern on the part of significant sections of the Sinhala majority.
But now, suddenly, Rajapaksa looks vulnerable - though it is a change in fortune which has little to do with the very serious allegations of command responsibility for the massacres at the end of the war. Instead it is growing concern over nepotism and corruption and, in particular, the concentration of power and wealth in the hands of his brothers and, increasingly, his son Namal.
He called the election two years early amid some concern that his popularity could be waning - but it seems he had little anticipated how fast that might happen, or how adept the opposition was at finding a "united opposition" candidate, his former health minister, Maithripala Sirisena, who has won over a significant numbers of defectors from his government.
The 'national question'
Rajapaksa has responded by ramping up the unashamed Sinhala-nationalism of his rhetoric: the claim that he freed the nation from the tyranny of the Tigers. His message to the Sinhala majority is designed to reinforce their conviction that Sri Lanka is a Sinhala nation, indivisible - and that the Tamils of the north and east must accept that, or have that forced upon them.
Those Tamils, on the other hand, almost universally believe that they will never be free and equal until they have political genuine autonomy. Whether that can only be guaranteed through independence or whether significant devolutionary or federal mechanisms can be made to work is the subject of profound debate - and division - within the Tamil community.
This "national question" is the single most important issue facing Sri Lanka. Yet it is the one issue on which you cannot find a sliver of difference between Rajapaksa and his opponent, Maithripala Sirisena.
Both key candidates are united in declaring that they will not co-operate with the UN inquiry into the war crimes and human rights abuses. Both have pledged that senior commanders will not face legal action over war crimes. Both are united in stating that Sri Lanka is indivisible. And both calculate that the climate of Sinhala triumphalism following the war cannot be questioned if they are to win the key Sinhala vote.
Ongoing Tamil oppression
On other issues there are important differences. Sirisena has pledged to end the corruption of the Rajapaksa era, re-establish the independence of the judiciary and the rule of law. He says he will reduce the powers of the executive presidency and re-establish the primacy of parliament. But Sirisena has made it clear he is in effect talking about those things only for the Sinhala majority.
He will not challenge the ongoing repression of Tamils in the north and east. He will not take on the hugely powerful and inflated military - or reduce their bases in the north. He will not willingly entertain serious discussions about the kind of political reforms that might satisfy the Tamils. He will not seek justice for the war crimes that were committed at the end of the war. Indeed, the former army commander, Sareth Fonseka - a man himself facing charges of responsibility for war crimes - will probably be a key member of his government.
Faced with that, some Tamils have taken the view that they cannot support Sirisena against Rajapaksa, because neither offers any policy to recognise the legitimate grievances of the Tamils.
But the majority of Tamils - including the sometimes fractious alliance which is the main voice in the north and east, the Tamil National Alliance - eventually threw their weight behind Sirisena on the grounds that although he would not take them nearer to political solutions and justice, getting rid of Rajapaksa would at least remove one block to such progress.
Many are conscious that it was the decision of former LTTE leader, Velupillai Prabhakaran, to call for a boycott of the 2005 presidential election that allowed his nemesis, Rajapkasa, to get into power in the first place.
Other key parties, including the Sri Lanka Muslim Congress, which was a vital part of Rajapkasa's United People's Freedom Alliance government, have also backed Sirisena along with other government defectors.
Tomorrow's result is very difficult to call, but such opinion polls as have been conducted look close.
So two huge questions remain. Firstly, will the election be conducted fairly? There have already been several reports of pre-election violence, mainly against the opposition, the misuse of the military for campaigning, and the profligate distribution of perks to government employees to buy their loyalty.
But an even more important question is what will happen if Sirisena wins.
If Rajapaksa is beaten, a whole house of cards, carefully constructed under his reign, comes down. The stakes are enormously high, and Rajapaksa may not go quietly.
But there could be another effect. For the international community - even for near neighbours like India - there is a suggestion that Rajapaksa is becoming a bit of an embarrassment.
But some observers fear that the demise of his regime could also take the pressure off in the international campaign for truth, justice and accountability over the crimes at the end of the war.
If that international momentum is lost, they fear, the urgent need for democratic and peaceful solutions to Sri Lanka's underlying political divisions could be further delayed.