COLOMBO, Sri Lanka — The president of Sri Lanka dissolved the country’s Parliament on Friday night and called for elections in January to choose new lawmakers, a move that critics said was illegal, and that deepened a two-week-old constitutional crisis over who is the legitimate prime minister of the island nation.

The move followed President Maithripala Sirisena’s dismissal in late October of Sri Lanka’s prime minister, Ranil Wickremesinghe, and his naming as a replacement a popular former president who had been accused of human rights abuses, nepotism and excessively close ties to China during his tenure.

Mr. Wickremesinghe and many members of Parliament challenged the appointment of his successor, Mahinda Rajapaksa. No major foreign country, including the United States, has recognized the new government. They have urged Sri Lankan leaders to allow Parliament to choose between the two men.

Sri Lanka, strategically located off the coast of India, is deeply in debt to China and was forced to turn over control of an important port to that country. Its close ties to China have alarmed both the United States and India, which fear China’s growing influence in the region.