Until just a couple of months ago, Mahinda Rajapaksa's third term in office seemed a mere formality. He was the king-like figure who ended a 25-year old civil war with the Tamils, the government was an extension of his family. And he was a charismatic campaigner, much like India's Narendra Modi.
But then he hadn't counted on competition from his own camp. His health minister, close aide and No.2 in the Freedom Party -- Maithripala Sirisena
At a news conference in late November, a day after sharing dinner with the president, Sirisena announced he would run as an opposition candidate, thus setting off a campaign that would eventually unseat Rajapaksa
The mild-mannered 63-year-old became an unlikely rallying point for Sri Lankans disaffected with corruption and nepotism charges against the Rajapaksa regime.
Sirisena pledged to reform the presidency within 100 days, abolishing many of its executive powers and returning the country to a Westminster-style parliamentary democracy where the police, the judiciary, and the civil service are independent institutions.
"From tomorrow, we will usher in a new political culture," he said as he cast his vote on Thursday.
Like Rajapaksa, the former health minister is a Buddhist from the majority Sinhalese community, but he managed to get the support of Sri Lanka's minority groups.
The Tamils who endured brutalities by the Lankan army towards the end of the 2008 civil war, and the Muslims who were at the receiving end of attacks by the Buddhist right, openly backed Sirisena
Former colleague Austin Fernando described Sirisena as a "mild-mannered, soft-spoken politician".
"He is unabrasive. A likeable chap who can easily command respect," said Fernando, a retired senior civil servant.
The decision to turn against the a powerful president demonstrated a steeliness that belies that mild reputation.Former army chief Sarath Fonseka, who mounted a failed bid to challenge Rajapakse in 2010, was jailed for over two and a half years on controversial charges and through an even more contentious legal process.
"I know what happened to General Fonseka can happen to me too," Sirisena said at the start of the campaign.
The son of a World War II veteran, Sirisena entered parliament in 1989 after settling in the eastern district of Polonnaruwa, where he had worked as a local government official.
He was jailed for nearly two years after being arrested on suspicion of leading a revolt against the government in 1971 when he was just 20.
Sirisena was a soft target for the Tamil Tiger rebels during the height of fighting and claims the separatists may have tried to assassinate him on at least five occasions.
Modi, Kerry congratulate
Among the first to congratulate Sirisena was Prime Minister Narendra Modi who assured him India's 'continued solidarity and support for Sri Lanka's peace, development and prosperity.'
US secretary John Kerry too congratulated him immediately indicating the two countries would like to see him as a bulwark against the Chinese influence in the region which increased during Rajapaksa's time.
Sirisena however has promised that he would not allow any international probe against 2008 'war heroes', which automatically implies an immunity for Rajapaksa.
And, despite the overwhelming support from the Tamil and Muslim minorities who constitute nearly 20% of the country's population, he is unlikely to make any political step that would alienate the Buddhist right.