COLOMBO, Sri Lanka — Sri Lanka's Supreme Court on Tuesday suspended the president's order to dissolve Parliament and hold new elections, opening the way for lawmakers to vote on whether to accept his earlier ouster of the prime minister.

Sri Lanka has been in a political crisis since Oct. 26, when President Maithripala Sirisena suddenly fired Prime Minister Ranil Wickremesinghe and replaced him with former strongman Mahinda Rajapaksa.

A day later Sirisena suspended Parliament, apparently to allow Rajapaksa time to gather support among lawmakers. But Wickremesinghe insisted his firing was unconstitutional. He refused to vacate his official residence and demanded that Parliament be summoned to prove he still has support.

Amid mounting pressure from political opponents and foreign governments, including the United States and the EU, to convene Parliament to end the impasse, Sirisena announced the legislature would return this Wednesday.

But last Friday, he instead dissolved Parliament and called new elections in January. Opponents said Sirisena made the decision because Rajapaksa had been unable to assemble a majority.

The Supreme Court ruled Tuesday to suspend the president's order until Dec. 7, after 13 political parties and individuals filed petitions with the court calling the dissolution unconstitutional. It said it would hold hearings on the case starting Dec. 4.

Wickremesinghe welcomed the ruling, calling it "a resounding victory for people's franchise."

"The powers of the president are limited. The president must act according to the law, he is not above the law," he said.

Hours after the court's ruling, the office of the speaker of Parliament announced that lawmakers would meet at 10 a.m. Wednesday.

Wickremesinghe said he was ready to "show that we have the majority and that we are the legitimate government of Sri Lanka."

After the ruling was announced, hundreds of opposition supporters who had gathered near the court cheered and lit firecrackers.

Jehan Perera, executive director of the National Peace Council of Sri Lanka, said the order "proves that Sri Lanka's judiciary is independent and that they were prepared to give a judgment that went against the executive."

"That's a positive indication of the continuing strength of Sri Lanka's institutions and their independence which is important to the sustenance of our democracy," he added.

Tensions had been building between Sirisena and Wickremesinghe for some time, as the president did not approve of economic reforms introduced by the prime minister. Sirisena has also accused Wickremesinghe and another Cabinet member of plotting to assassinate him, a charge Wickremesinghe has repeatedly denied.

Sirisena was also critical of investigations into military personnel who were accused of human rights violations during Sri Lanka's 25-year civil war against a Tamil separatist group, which ended in 2009.

Rajapaksa, who was president from 2005 to 2015, is considered a hero by some in Sri Lanka's ethnic Sinhalese majority for ending the war by crushing the Tamil rebels.

But his time in power was marred by allegations of war-time atrocities, corruption and nepotism.