Pakistan's Supreme Court has ruled that former prime minister Nawaz Sharif cannot head the country's ruling party.

The court's decision on Wednesday comes months after Sharif was "deemed unfit to hold public office" over corruption allegations and forced to step down, Pakistan's Dawn news outlet reported.

A subsequent law, known as the Elections Act 2017, was passed by the ruling Pakistan Muslim League-Nawaz (PML-N) party last year, which allowed Sharif to retake his post as party leader despite the charges against him.

In the decision, the court ruled someone disqualified under tenets of the Pakistani constitution cannot head a political party, Dawn reported.

Chief Justice Mian Saqib Nisar ordered the Election Commission of Pakistan to remove Sharif as party head from all relevant records, AFP news agency reported.

"As a result, all steps taken, all orders passed by Nawaz Sharif are also declared to be as if they had never been taken," Nisar said, as reported by Reuters news agency.

Rising instability

Political analysts said the decision raises serious questions about political stability in Pakistan.

"It has created a serious crisis for [PML-N] ... and it has also created uncertainties about the direction of [the] Pakistani political system," analyst Hasan Askari told AFP.

Askari said Senate elections, scheduled for next month, may be postponed as a result of the court's ruling.

{articleGUID}

The PML-N controls Pakistan's lower house of parliament.

Winning control of the Senate would allow the party to change the constitution to make Sharif eligible to hold office again when the party runs in national elections, expected to be held later in 2018.

Raza Ahmad Rumi, an editor at the Daily Times Pakistan, said while the decision "was not unexpected", it was "a miscalculation by [the] powers-that-be".

"Nawaz Sharif is likely to gain more sympathy and his party more votes in the coming elections," Rumi wrote on Twitter.

Meamwhile, members of PML-N accused the court of bias, with Information Minister Marriyum Aurangzeb saying the judiciary was "only targeting one person", Pakistani newspaper The Express Tribune reported.

A three-time prime minister, Sharif has denied allegations of corruption.

He has been accused of failing to declare monthly income amounting to more than $2,700 from a company owned by his son. He also appeared in an anti-corruption court last October to face separate corruption charges.