Mahinda Rajapaksa's stepping down signals an end to the seven-week long power struggle in Sri Lanka.

Sri Lanka's strongman leader Mahinda Rajapaksa will step down from his disputed position of premier, his son said Friday, signalling an end to a crippling seven-week long power struggle.

Rajapaksa's legislator son Namal said he will quit Saturday "to ensure stability of the nation", after the Supreme Court ordered that he should not exercise the powers of the office he has claimed since October 26.

Namal Rajapaksa said they will join a coalition with President Maithripala Sirisena who triggered the political crisis on October 26 by sacking Prime Minister Ranil Wickremesinghe and replacing him with former foe Rajapaksa.

The latest decision of Rajapaksa to back down came as the Supreme Court ruled that he and his purported cabinet should not exercise the powers of the office they claim until he could prove his legitimacy.

The court ruling also meant that the country was effectively without a government and heading for a shut down in the absence of parliament voting for a budget for 2019.

In another blow to Sirisena, the highest court ruled on Thursday that his sacking of parliament on November 9 was illegal and cancelled a snap election he had called for January 5.

Rajapaksa failed to prove his majority in parliament and was twice defeated in no-confidence motions on November 14 and 16, but refused to step down.

Wickremesinghe also refused to step down since October 26 maintaining that his sacking was illegal. That issue is currently being canvassed before courts.

Political sources said Sirisena was likely to invite Wickremesinghe to form a new government over the weekend and end the power vacuum.