Pakistan will vote in elections on February 8, with rights groups warning the ballot will lack credibility with popular opposition leader Imran Khan jailed and barred from contesting.
Three-time prime minister Sharif—regarded as the favourite in Khan's absence—was last ousted by the Supreme Court in 2017, and a subsequent ruling saw him barred from office for life over graft.
He left jail for self-imposed exile in the UK in 2019 but returned to Pakistan in October and has seen the numerous legal cases plaguing him voided in quick succession.
Analysts say the 74-year-old is benefiting from a reformed relationship with the powerful military establishment, which has long dictated the politicians who hold high office.
On Monday, a Supreme Court ruling said it cannot enforce lifetime bans from office because it "abridges the fundamental right of citizens to contest elections and vote for a candidate of their choice".
Nawaz's brother Shehbaz passed legislation in his tenure as prime minister last year dictating that bans from office be limited to five years.
Doubts had lingered that the move might clash with the decision barring Nawaz and numerous other politicians under a constitutional clause demanding they be "honest and righteous".
But the Supreme Court ruled the constitution does not dictate a disqualification period and backed the five-year ban legislated last year, saying it made exclusions subject to "the due process of law."
"The ruling goes in the favour of Nawaz Sharif, who will now be able to contest the elections, which will pave the way for his return to power," analyst Zahid Hussain told AFP.
"These clauses of the constitution have been very ambiguous, but now with this ruling, a sword hanging over the politicians has been removed."
Sharif is set to lead his Pakistan Muslim League (Nawaz) into the ballot, although campaigning has yet to kick off.
His most potent opponent and former prime minister Khan, 71, has not been allowed to register his candidacy on the basis of his own graft conviction last year.
Former international cricket star Khan was ousted by a parliamentary no-confidence vote in 2022 after souring relations with the military's top brass—historically the bane of elected leaders in Pakistan.
But he waged an unprecedented campaign of defiance, accusing them of conspiring with the United States to end his term and of plotting an assassination attempt which saw him wounded.
He has been jailed since August, buried under an avalanche of legal cases, whilst his Pakistan Tehreek-e-Insaf (PTI) party has been largely dismantled by a crackdown.
Sharif—who has never completed a full term in his trio of premierships—has always maintained his numerous corruption convictions were politically motivated.
Like Khan, he once blamed the military establishment for engineering them, but has tempered his anti-army rhetoric as his fortunes have transformed over the past months.