COLOMBO, Sri Lanka—The president of Sri Lanka dissolved the country’s Parliament on Friday night and called a snap general election on Jan. 5, a move that critics said was unconstitutional.

President Maithripala Sirisena’s order to dissolve Parliament came in the aftermath of his surprise appointment last month of a former president, Mahinda Rajapaksa, as premier.

The appointment of Mr. Rajapaksa, an authoritarian figure who ended the country’s civil war, brings back to power a leader who had pivoted the country toward China and was accused by opposition parties of corruption and human-rights violations.

The prime minister ousted in the action, Ranil Wickremesinghe, refused to leave the premier’s official residence and demanded a parliamentary vote to test his support.

With two politicians claiming to be Sri Lanka’s prime minister, the island nation has been caught in a constitutional crisis since last month.