President Maithripala Sirisena (Photo by Chris Jackson/Getty Images)

A Sri Lanka court Monday rejected calls to subject the president to a mental health examination after he sacked a former ally, dissolved parliament and plunged the country into crisis.

The Court of Appeal rejected a petition to force Maithripala Sirisena before a panel of psychiatrists to scrutinise his mental state in the wake of the political upheaval in the Indian Ocean island.

The turmoil began in October when Sirisena dismissed Sri Lanka’s prime minister and dissolved parliament, both decisions later overturned by the country’s highest court.

For more than a month, Sri Lanka drifted without a government as two rivals jostled for the prime ministership and protests rocked the capital Colombo.

The instability ended peacefully when Sirisena’s controversial appointee Mahinda Rajapakse stood down, and the deposed prime minister Ranil Wickremesinghe returned to power with the support of parliament.

Mental infirmity is grounds for removing a president if two-thirds of parliament agree, but no party or coalition in the legislature commands such a majority.

The two-judge bench of the appeals court said it did not have the jurisdiction to force Sirisena to be examined, and ordered the petitioner pay the state 100,000 rupees ($540) in legal costs.

Sirisena came to power in 2015 in a coalition with Wickremesinghe. But personal differences festered and their alliance imploded in October when Sirisena kicked his former ally out of office.

Wickremesinghe refused to stand down and allow Rajapakse, a former president and divisive war-era strongman, to take his place.

The crisis dragged on for weeks until the Supreme Court denied Rajapakse the right to rule and he bowed out in December.

Some factions within Sri Lanka’s parliament have pushed for Sirisena to be investigated for orchestrating an alleged coup.

(AFP)