Political analysts said Sirisena's move to install Rajapaksa as the PM could lead to a constitutional crisis.
Controversial Sri Lankan strongman Mahinda Rajapaksa staged a dramatic political comeback on Friday, becoming the new prime minister after president Maithripala Sirisena sacked premier Ranil Wickremesinghe who termed the move as "unconstitutional" and vowed to prove his majority in Parliament.
The sudden development came amid growing tensions between Sirisena and Wickremesinghe on several policy matters and the President has been critical of the Prime Minister and his policies, especially on economy and security.
Rajapaksa, 72, tweeted a photo of him and Sirisena after the swearing in ceremony at the Presidential Secretariat in Colombo.
"Former #SriLanka President Mahinda Rajapaksa sworn in as new Prime Minister," he said in the tweet.
Reacting sharply to his sacking, Wickremesinghe asserted that the swearing in of Rajapaksa in his place is "illegal and unconstitutional" and he will prove his majority in Parliament.
"I will continue to be the Prime Minister. Mahinda Rajapaksa's appointment is unconstitutional," he said.
Similarly, Finance Minister Mangala Samaraweera tweeted that "the appointment of Mahinda Rajapaksa as the Prime Minister is unconstitutional and illegal. This is an anti-democratic coup".
The political developments unfolded after Sirisena's broader political front United People's Freedom Alliance announced that it has decided to quit the current unity government with Wickremesinghe's United National Party.
Mahinda Amaraweera, agriculture minister and the general secretary of the UPFA, told reporters that the UPFA decision has been conveyed to Parliament Speaker Karu Jayasuriya.
The unity government was formed in 2015 when Sirisena was elected President with Wickremesinghe's support, ending a nearly decade-long rule by Rajapaksa.
Rajapaksa's return to power ends a more than three-year-old coalition government that was formed by Sirisena and Wickremesinghe on a promise to combat corruption and financial irregularities.
Sirisena, who was Rajapaksa's minister of health, broke away from him to contest the presidential elections.
Political analysts said Sirisena's move to install Rajapaksa as the prime minister could lead to a constitutional crisis as the 19th amendment to the Constitution would not allow the sacking of Wickremesinghe as the premier without a majority.
Rajapaksa and Sirisena combine has only 95 seats and is short of a simple majority. Wickremesinghe's UNP has 106 seats on its own with just seven short of the majority.
The unity government was thrown into a crisis after Rajapaksa's new party pulled off a stunning victory in local elections in February seen as a referendum on the ruling alliance.
Last week, it was reported that Sirisena accused his senior coalition partner the UNP of not taking seriously an alleged conspiracy to assassinate him and Gotabhaya Rajapaksa, the former top defence ministry bureaucrat and brother of ex-president Mahinda Rajapaksa.
Sri Lanka nearly faced economic sanctions from the West over Rajapakse's brutal military crackdown on the banned Liberation Tigers of Tamil Eelam.
The LTTE sought a separate Tamil homeland in the northern and eastern provinces of the island nation for nearly 30 years before its collapse in 2009 after the Sri Lankan Army killed its supreme leader Velupillai Prabhakaran.
Rajapaksa and his family were facing several cases of corruption and financial irregularities.