New Delhi: Controversial Sri Lankan Prime Minister Mahinda Rajapaksa who was appointed by President Maithripala Sirisena in a widely criticised move, resigned on Saturday.  He informed the UPFA legislators that he has resigned from the post, MP Shehan Semasinghe told reporters.

Rajapaksa was appointed single-handedly by Sirisena in a controversial move on October 26 as he sacked incumbent Prime Minister Wickremsinghe plunging a country in a constitutional crisis.

The apex court of the country on Friday declared that the dissolution of Parliament by Sirisena was "illegal" and refused to stay a court order restraining Rajapaksa, 73, from holding the office of Prime Minister until it fully heard the case next month.

Rajapaksa, in a meeting with President Sirisena on Friday decided to resign and allow the President to appoint a new government; after which President Maithripala Sirisena has reportedly agreed to reinstate ousted Prime Minister Wickremesinghe in the post.

He reportedly had a discussion with Wikcremsinghe over the phone on Friday.

Wickremesinghe is expected to take oath as Sri Lanka's Prime Minister on Sunday.