Sri Lankan President Maithripala Sirisena sacked the country’s Prime Minister on Friday and replaced him with a former strongman, an official said.

Sirisena informed Ranil Wickremesinghe that he is being replaced by his former nemesis, Mahinda Rajapaksa, a presidential aide said.

The aide, Mahinda Amaraweera, said Rajapaksa has the majority needed in the 225-member Parliament to run a stable government.

The move ends a more than 3-year-old coalition government that was formed by two bitterly opposed political parties on a promise to tackle corruption and wipe out alleged financial irregularities under the previous government, led by Rajapaksa.

Sirisena, who was health minister under Rajapaksa, and Wickremesinghe joined forces to defeat Rajapaksa in elections in 2014, accusing him of corruption and undemocratic rule. Sirisena was chosen president largely through votes from Wickremesinghe’s party.

There was no immediate comment from Wickremesinghe.

“The appointment of Mahinda Rajapaksa as prime minister is unconstitutional and illegal. This is an undemocratic coup," Mangala Samaraweera, the finance minister of the outgoing government, said on his Facebook page.