Here are the main players in the volatile political scene of back-stabbing and shifting sands in the strategically important Indian Ocean island of 21 million people.
Mild-mannered but steely-nerved President Maithripala Sirisena, 67, was a relative unknown until his shock defeat of Mahinda Rajapakse in presidential elections in 2015.
Sirisena had walked out of Rajapakse's government a day after the two men had dinner together, and accused his former ally of plotting to assassinate him if he lost the election.
"If I had not won the presidency, I would be six feet under by now," he told a public rally after his win.
Usually dressed in spotless white, Sirisena vowed to do all in his power to stop the highly divisive Rajapakse becoming prime minister and appointed Ranil Wickremesinghe instead.
Two weeks ago -- almost four years after he first turned his back on Rajapakse -- Sirisena dismissed Wickremesinghe and appointed Rajapakse in his place. Late Friday he called elections and dissolved parliament.
Having loaned his government billions, China swiftly congratulated Rajapakse, 72, on his new appointment but India and the West were less pleased -- to say little of the Tamil minority.
As president from 2005 until 2015, Rajapakse ended Sri Lanka's four-decade civil war in 2009 by crushing the Tamil Tigers. But 40,000 ethnic Tamils were allegedly massacred in the process.
Sri Lanka's media, remembering the 17 journalists and media workers killed under Rajapakse, are also fearful about his comeback. He and his family are also accused of corruption.
But with his trademark macho moustache, traditional national dress and outsize personality, Rajapakse remains a hero for many Sinhalese, deftly portraying himself as a man of the people.
"A general election will truly establish the will of the people and make way for a stable country," he tweeted in the early hours of Saturday.
But Wickremesinghe, 69, calls his sacking, the snap elections and the suspension of parliament illegal, and is refusing to vacate the prime minister's official residence, where he has been holed up since October 26.
Silver-haired and often in Western-style suits, Wickremesinghe has been prime minister four times, the first time after the Tamil Tigers assassinated the then-president in 1993.
During his 2001-4 time in office, Wickremesinghe is credited with pulling Sri Lanka out of its first ever recession, in part with reforms that have endeared him to the West.
"You have not let this country be plunged into the darkness of dictatorship," Wickremesinghe said in a video message on Thursday thanking his supporters.
Sri Lanka's Supreme Court on Tuesday overruled Sirisena's dissolution of parliament and ordered a halt to preparations for snap elections next year.
Wickremesinghe's party led the petitions against the dissolution and the three-judge bench, headed by the Chief Justice Nalin Perera, read out the decision to a packed court guarded by hundreds of heavily armed police and commandos.
The court suspended a proclamation issued by Sirisena on Friday sacking the legislature and calling for elections on January 5.
The ruling means parliament could go ahead with a vote to test if Sirisena's controversial nominee is able to summon a majority in the 225-member assembly and force Wickremesinghe from office.
The court also ordered the independent Elections Commission to halt preparations for the January 5 vote.
A crisis sparked by the Sri Lanka president when he fired his prime minister on October 26 deepened Tuesday when the Supreme Court rejected his subsequent sacking of parliament.