The country is split down the middle, with parliamentarians slightly tilted toward Prime Minister Ranil Wickremesinghe, who is standing his ground despite attempts to replace him with Mr. Rajapaksa.

Sri Lanka, one of Asia’s oldest democracies, has now been left with two prime ministers claiming legitimacy, and concerns that violence might be used to break the stalemate.

Though the current crisis appeared to have been at least partly caused by bitter personal differences between the leaders, it has geopolitical importance. India and China have been locked in an expensive competition for influence in Sri Lanka, and Mr. Rajapaksa’s allies blame his 2015 election defeat on meddling from New Delhi. India denies the allegations.

Mr. Wickremesinghe said that any legitimate confidence vote in Parliament would confirm that he still had the votes to remain in office. “I am confident that I am the only one who can get a majority. If someone else can show a majority, I will give way,” Mr. Wickremesinghe said in a news conference on Monday.