Sri Lanka's crisis looked over on Saturday as strongman Mahinda Rajapakse bowed out of a power battle that had crippled the island nation for seven weeks and sent it heading for a possible debt default.
Rajapakse held a multi-religious service at his home where he signed a letter backing down from the post of prime minister controversially conferred on him on October 26.
Hours after the receiving blessings from the clergy, the 73-year-old ex-president sounded bitter and vowed to make a comeback at local council elections.
"There is no doubt at all that the people who stood by us since 2015 will continue to support us in the future as well," he said addressing his close associates. "We will bring the forces opposed to the country down to their knees by organising the people."
His aides said he was returning a fleet of limousines he had used since his disputed appointment.
President Maithripala Sirisena triggered the political turmoil by sacking premier Ranil Wickremesinghe and replacing him with his flamboyant former foe Rajapakse.
But Wickremesinghe refused to step down insisting that his sacking was illegal, leaving the Indian Ocean nation of 21 million people with two men claiming the premiership.
Rajapakse was then defeated in a no-confidence motion on November 14.
However, the following day, Speaker Karu Jayasuriya ruled that he would recognise neither man as prime minister, leaving Sri Lanka effectively without a government.
- Risked sovereign default -
The country was then heading for a government shutdown as parliament failed to approve spending for 2019 and credit rating agencies downgraded its debt amid fears of a sovereign default.
There were doubts about the country's ability to repay $1.5 billion due to bond holders by January 10 without a legally constituted administration.
Rajapakse's son Namal had announced Friday that his father -- who as president ended Sri Lanka's civil war in 2009 amid allegations of grave rights abuses -- would throw in the towel "to ensure stability".
Rajapakse's decision came after the Supreme Court confirmed that he could not exercise the powers of a prime minister until he proved his legitimacy, which without enough support in parliament was impossible.
In a major climbdown, Sirisena agreed on Friday to reinstate Wickremesinghe on Sunday despite previously insisting he would never in his lifetime reappoint him as prime minister.
There was no immediate comment from Sirisena or his office on Saturday.
But an MP from his party, Lakshman Yapa Abeywardena, told reporters on Friday night that the president agreed to the latest measures to avoid a government shutdown after December 31.
"If the stalemate continued, we would have ended up without a budget for 2019 and the government would not have been able to function," Abeywardena said.
On Wednesday, the legislature had voted overwhelmingly to demand the reinstatement of Wickremesinghe.
The leftist JVP, or the People's Liberation Front, insists that Sirisena should be investigated for orchestrating what they call a coup and that there should also be an impeachment process.
On Thursday Sirisena suffered a major blow when the Supreme Court ruled that he had breached the constitution on November 9 by dissolving parliament and calling early elections.
His sacking of parliament had earlier been suspended, but the legislature descended into farce on multiple occasions with MPs throwing punches, hurling projectiles and chili powder and boycotting proceedings.
Colombo, Sri Lanka | AFP