COLOMBO (Reuters) - Sri Lankan President Maithripala Sirisena’s decision to dissolve parliament ahead of its term is unconstitutional, the Supreme Court ruled on Thursday, a setback for the embattled leader in his dispute with an ousted prime minister.

Slideshow ( 2 images )

Sirisena dissolved parliament last month and called a general election for Jan. 5, days after sacking Prime Minister Ranil Wickremesinghe and naming opposition leader Mahinda Rajapaksa to the post.

The court said Sirisena could not dissolve parliament before it had completed most of its five-year term.

“The president can’t dissolve parliament before four-and-half years,” judge Sisira de Abrew said in summing up the verdict of a seven-judge bench.

The ruling raises the possibility of Wickremesinghe being reinstated as prime minister since his coalition enjoys a majority in parliament.

Sirisena has repeatedly said he will not appoint Wickremesinghe even if he has the backing of all 225 members of parliament.

There was no immediate comment from Sirisena’s office.

Many foreign countries have yet to recognize Rajapaksa’s government. Credit rating agencies Fitch and Standard & Poor’s have downgraded Sri Lanka, citing refinancing risks and an uncertain policy outlook.

On Wednesday, parliament passed a vote of confidence in Wickremesinghe.

“We trust that the president will promptly respect the judgment of the courts,” Wickremesinghe tweeted after the ruling.

“The legislature, judiciary, and the executive are equally important pillars of a democracy and the checks and balances that they provide are crucial to ensuring the sovereignty of its citizens,” he said.

Rajapaksa was not immediately available for comment.

His son Namal, a lawmaker, tweeted: “We respect the decision of .... Supreme Court, despite the fact that we have reservations regarding its interpretation”.