Sri Lanka’s top court has ruled that the president’s dissolution of parliament last month was unconstitutional, as a political crisis continues to grip the nation.

President Maithripala Sirisena dismissed his prime minister and replaced him with former leader Mahinda Rajapaksa in late October.

When that decision was contested, he dissolved parliament.

The ruling could see sacked PM Ranil Wickremesinghe return to office.

The legislature – which has been sitting after a temporary ruling from the Supreme Court – has already passed two no-confidence motions against Mr Rajapaksa.

The controversial but popular leader was president at the end of Sri Lanka’s nearly three decade-old civil war in 2009 and is accused of presiding over vast human rights abuses, which he denies.

On Wednesday, the parliament passed a vote of confidence in Ranil Wickremesinghe as prime minister.

His party and its allies have a majority in parliament.

The political crisis, which began on 26 October when President Sirisena shocked the nation by suddenly sacking his PM, is being closely watched by the US, India, China and the European Union,

The government has been in paralysis since an appeals court ruling last week that restrained Mr Rajapaksa from acting as prime minister, in a separate case brought by 122 MPs.

The crisis has hurt tourism, which makes up about 5% of the country’s economy.