COLOMBO (NYTIMES, AFP, REUTERS, BLOOMBERG) - When Sri Lanka's President Maithripala Sirisena was elected in 2015, he was given a sweeping mandate from voters to investigate accusations of war crimes and graft against his predecessor's government and to cancel deals with China that had plunged the country into debt.
Now, Mr Sirisena has become an agent of the attempted comeback of the man he replaced, Mr Mahinda Rajapaksa.
Mr Sirisena has unilaterally suspended Parliament and the Cabinet and declared that Mr Rajapaksa would immediately become the new prime minister.
The Parliament and public that once rallied around Mr Sirisena are now bitterly divided over what his critics call an unconstitutional attempt to consolidate power.
The country is split down the middle, with parliamentarians slightly tilted toward Prime Minister Ranil Wickremesinghe, who is standing his ground despite attempts to replace him with Mr Rajapaksa.
Sri Lanka, one of Asia's oldest democracies, has now been left with two prime ministers claiming legitimacy and there are concerns that violence might be used to break the stalemate.
Here's what you need to know about the crisis:
1. WHO ARE THE MAIN PLAYERS?
Under Sri Lanka's semi-presidential system of government, the president exists alongside a prime minister and a Cabinet. The prime minister is responsible to the legislature of the country.
In December 2014, the country was stunned when Mr Sirisena, a senior member of then President Rajapaksa's Cabinet, crossed over to join the opposition.
The joint opposition led by former president Chandrika Bandaranaike Kumaratunga and three-time prime minister Wickremesinghe declared that Mr Sirisena would be their candidate to challenge Mr Rajapaksa in elections the following year.
In the presidential election, Mr Sirisena defeated Mr Rajapaksa, following which the United National Party (UNP) and the Sri Lanka Freedom Party (SLFP) came together to form a "national unity" government with Mr Sirisena as President and Mr Wickremesinghe as Prime Minister.
Relations between Mr Wickremesinghe and Mr Sirisena have been strained this year, especially after their coalition was defeated in local government elections by a party backed by Mr Rajapaksa.
Mr Wickremesinghe on April 4 survived a no-confidence vote brought by Rajapaksa loyalists. Mr Sirisena had also shuffled his Cabinet several times and this month called for a change in leadership at Sri Lanka's two main state banks, people who had been picked by Mr Wickremesinghe.
"Sirisena's drive to push out Wickremesinghe points to his attempts to preserve his political standing," said Mr Shailesh Kumar, Asia director with political risk firm Eurasia Group, adding that the local election results showed Mr Rajapaksa maintained strong support.
Over the weekend, both men lobbied lawmakers for support. Mr Rajapaksa's supporters seemed well prepared for the surprising shift of power. By Sunday, posters and billboards sporting a smiling Mr Sirisena and Mr Rajapaksa had popped up around the capital.
2. HOW DID THE CRISIS UNFOLD?
In a surprise move, President Sirisena's office announced last Friday (Oct 26) that he had sacked Mr Wickremesinghe, with whom he had ruled in a coalition since 2015.
Moments later, the new Prime Minister was named - former strongman leader Rajapaksa, who was shown on television being sworn in during a rushed ceremony.
The shock dismissal came after disagreements between Mr Sirisena and Mr Wickremesinghe over economic policy as well as day-to-day government administration.
Mr Rajapaksa is highly controversial, having ruled with an iron fist from 2005 to 2015, with his government accused of corruption and murdering political opponents.
During his term, a decades-old Tamil Tiger separatist struggle was stamped out in 2009 through a military assault that killed up to 40,000 ethnic Tamil civilians.
Mr Wickremesinghe hit back that his sacking was not legal and vowed to fight it in court. After winning the premiership a third time in August 2015, he had overseen a constitutional amendment that removed the head of state's power to sack prime ministers.
Overnight on Friday and into Saturday, Rajapaksa loyalists stormed two state-owned television networks which they regarded as loyal to the outgoing government and forced them off the air.
Last Saturday, Mr Wickremesinghe demanded an emergency session of Parliament so that he could prove his majority. Mr Sirisena responded by suspending the assembly until Nov 16.
Police cancelled all leave as tensions mounted in Colombo. Mr Wickremesinghe continued to occupy the official prime minister's residence, Temple Trees, as around 1,000 of his supporters gathered outside.
Ambassadors from India, the US and European nations called for the rivals to respect the Constitution.
On Sunday, privately run newspapers described Mr Sirisena's move as a "constitutional coup".
Parliamentary speaker Karu Jayasuriya said he recognised Mr Wickremesinghe as the country's lawful prime minister, until another candidate could prove a majority in Parliament.
The sacked prime minister ignored a deadline to vacate Temple Trees, where his supporters and chanting monks stood guard with soldiers deployed nearby.
Later on Sunday, bodyguards for petroleum minister Arjuna Ranatunga, who is allied to Mr Wickremesinghe, opened fire inside a government ministry, as a mob loyal to Mr Sirisena besieged his office.
A 34-year-old man was killed and two other people injured. The US State Department called on Mr Sirisena to "immediately reconvene Parliament" to allow representatives there to quell the crisis.
On Monday, Mr Wickremesinghe said his sacking has left the country in a power vacuum while Speaker Jayasuriya warned of a potential "bloodbath".
Police arrested Mr Ranatunga after trade unions accused him of ordering the previous day's shooting.
Meanwhile, Mr Sirisena appointed a 12-member Cabinet, giving the powerful finance portfolio to Mr Rajapaksa.
3. WHAT ARE THE INTERNATIONAL IMPLICATIONS?
Sri Lanka is one of a chain of countries where the India-China rivalry is playing out, stretching from Bangladesh and Nepal to the Maldives, where a pro-China leader was voted out in a surprise election result last month that was welcomed by India, the United States and the European Union.
The appointment of Mr Rajapaksa - whose administration was criticised by human rights groups for extrajudicial killings, enforced disappearances and jailing journalists - is good news for China, which enjoyed close ties with Sri Lanka during a 10-year rule that saw the island nation rack up large debts to fund infrastructure projects.
During Mr Rajapaksa's rule, China found an opening to pull Sri Lanka more closely into its orbit through billions of dollars in loans, some for the ruling family's pet projects.
The projects and the debt they accumulated became an election issue in 2015, with Mr Sirisena and Mr Wickremesinghe cooperating to run on an anti-China platform. But once they came to power, they realised that India and the US - which had also been critical of Mr Rajapaksa's rule - did not have China's deep pockets, and began to gravitate toward Beijing once again.
Last year, the government handed over the Hambantota seaport to China in a 99-year lease after the government could not repay the money Mr Rajapaksa's government had borrowed to build the port.
China has been nimble in its diplomacy, too. Shortly after Mr Sirisena came to power, China's government built a hospital in his home district. After a public uproar over the Hambantota port this year, China gave Mr Sirisena a grant worth nearly US$300 million (S$414.85 million), which the President boasted was for "any project of my wish".
Western governments have rallied around Mr Wickremesinghe in the crisis, and the loans and grants they have given this government in recent years may be at risk unless the Prime Minister is restored. But that money pales in comparison to the loans China has provided.
China's ambassador to Sri Lanka, Mr Cheng Xueyuan, was among the first diplomats to meet Mr Rajapaksa soon after he was sworn in as Prime Minister, and he presented a congratulatory message from Chinese Prime Minister Li Keqiang.
Mr Wickremesinghe had attempted to re-balance Sri Lanka's foreign relations away from China and towards India and Japan.
India, caught flatfooted by the appointment of Mr Rajapaksa as Sri Lanka's premier, has opened urgent diplomatic and political contacts with the strongman, officials said on Monday.
Mr Rajapaksa had opened up Sri Lanka's main port to Chinese naval submarines when he was President, which stoked anger in India. His return to power has drawn concern in New Delhi that China would tighten its grip on the island that lies along busy shipping lanes.
China has in recent years faced criticism that many of its investments in Sri Lanka, the Maldives and other countries run the risk of driving smaller nations into debt and potentially impinge on their sovereignty.
In a national speech on Sunday evening, Mr Sirisena claimed that a Cabinet minister he did not identify had been hatching a plot to assassinate him. The claim came weeks after The Hindu, a major Indian daily, reported that Mr Sirisena had told allies that India's intelligence agency was also planning to assassinate him. Mr Sirisena later denied that report.
4. WHAT HAS THE IMPACT ON THE ECONOMY BEEN?
Sri Lanka's sovereign dollar bonds and the rupee plunged to record lows, while the nation's stocks surged the most in five years, as the political turmoil sent equity and bonds investors to opposite ends of the risk spectrum.
Tight monetary and fiscal conditions and a farm sector that has faced a spate of difficult weather - including both droughts and floods - has led to the island nation's stuttering economic growth that fell to a 16-year low of 3.3 per cent last year.
This month, the International Monetary Fund (IMF) revised down its projection for 2018 economic growth to under 4 per cent, from June's forecast of 4 per cent.
Moody's Investors Service said the crisis would inflict lasting damage to investor confidence. Stock bulls, including Mr Mark Mobius took a different view, namely that the upheaval may pave the way for a government focused on boosting economic growth.
The upheaval comes as Sri Lanka faces significant bond maturities, including a US$1 billion bond due in January and a US$500 million debt due in April, according to data compiled by Bloomberg.
The crisis is credit negative and uncertainty about the direction of Sri Lanka's future policy could dent investor confidence, Moody's said.
Still, there may be a silver lining to the political problems, as there could be a more focused government programme with Mr Rajapaksa back in the driver's seat, Mr Mobius, co-founder of Mobius Capital Partners, said in a Bloomberg interview.
"We could see some positive sentiment from local investors who perceive that Sirisena and Rajapaksa could work better together to boost growth," says Mr Adrian Perera, chief operating officer at Equicapital Investments in Colombo. "Foreign investors will hold back, but we can expect Chinese investments to come in and even boost the currency."
The re-entry of Mr Rajapaksa, who had a "cosy relationship" with China, could lead Sri Lanka to pivot back to China, potentially re-opening the doors to Chinese funding, according to Nomura International (HK).
"The immediate priority for Sri Lanka is to refinance the upcoming maturities, and Chinese backing should prove helpful," Mr Nicholas Yap, a desk analyst at the bank, wrote in a note.
The uncertainty comes at a turbulent time for emerging market assets, which extended declines last week amid a global rout in equities.
It also comes at a crucial time for Sri Lanka, as the International Monetary Fund, under which the nation has a US$1.5 billion programme, has been calling for reforms to spur its economy.
The constitutional uncertainty could impact the timing of Sri Lanka's budget, according to Aberdeen Standard Investments.
5. WHAT NEXT FOR SRI LANKA?
Mr Wickremesinghe says his sacking was illegal and he is still Prime Minister, with the support of a majority of members of Parliament.
"The only way out of this crisis is to resolve who has the majority. Once Parliament is summoned, this issue can be resolved," Mr Wickremesinghe told reporters at the prime minister's official residence.
Mr Rajapaksa, meanwhile, assumed his duties on Monday at the prime minister's office, about 1km away.
Also on Monday, the President named new Cabinet ministers, putting Mr Rajapaksa in charge of finance and giving portfolios to four lawmakers who defected from supporting Mr Wickremesinghe to back Mr Rajapaksa.
China, long seen as a supporter of Mr Rajapaksa, has already congratulated him on becoming Prime Minister.
But India, the EU and the US have all urged Mr Sirisena to abide by the Constitution.
"We call on the President, in consultation with the Speaker, to immediately reconvene Parliament and allow the democratically elected representatives of the Sri Lankan people to fulfil their responsibilities to affirm who will lead their government," US State Department spokeswoman Heather Nauert said in a statement.
Sources in diplomatic missions said most foreign envoys had yet to congratulate Mr Rajapaksa, as it could be interpreted as legitimising the new government while there were still complaints his appointment was unconstitutional.
The Speaker of Parliament, Mr Jayasuriya, called for differences to be resolved in the legislature.
"If we don't resolve this in the Parliament, some people may try to resolve things on the streets," he warned.