Pakistan's most popular politician, former Prime Minister Nawaz Sharif, suffered a major setback Monday when a court ruled him ineligible to run in upcoming parliamentary by-elections.

The decision was expected to deepen a rift between Sharif and his partner in the governing coalition over reinstating fired judges and could further destabilize the government in a nation seen as an important ally in the U.S.-led war on terror.

"This ruling will undermine, in a major way, the effort for national reconciliation," said Nasim Zehra, an analyst and fellow at Harvard University's Asia Center. "It is not a politically sustainable judgment."

Sharif had been barred from running in February elections because of convictions related to his ouster in a 1999 coup, which was led by the current president, Pervez Musharraf. Earlier this month, the election commission effectively cleared him to run in Thursday's by-elections after a tribunal set up to decide the matter failed to reach consensus.

However, the Lahore High Court, acting on a petition from a candidate and a voter, ruled Monday that Sharif, a bitter Musharraf opponent, was ineligible to run for parliament. The move effectively barred him from becoming prime minister.

Sharif's allies were furious, with dozens chanting "Go Musharraf go" outside the court and angry lawmakers walking out of the provincial assembly in protest, according to television reports.

About 100 Sharif supporters in Multan burned tires in the street.

Ahsan Iqbal, a spokesman for Sharif's Pakistan Muslim League-N party, said the ruling made Pakistan look like a "banana republic," and he lashed out at Asif Ali Zardari, head of the Pakistan People's Party, the senior partner in their ruling coalition.

The two party leaders have had sharp disagreements over how to reinstate dozens of senior judges that Musharraf fired during a state of emergency last year. Sharif, who pulled his members from the Cabinet over the rift, has demanded the government immediately restore the judges to the bench and remove their replacements, who he says are pawns of Musharraf.

Zardari, the husband of slain leader Benazir Bhutto, has sought to link the return of the judges to constitutional reforms that could take months to pass and has called for keeping the replacement judges on the bench along with their predecessors.

Speaking on Dawn TV, Iqbal asked how, in the wake of Monday's court ruling, Zardari's party could let the courts "continue to play mockery with democracy in this country, continue to play mockery with the fundamental rights of the citizens of Pakistan."

Farhatullah Babar, a spokesman for Zardari's party, said he was disappointed with the ruling, but thought it might spur the parties to sort out their dispute over the judges.

Ashtar Ausaf, Sharif's lawyer, told Dawn News TV that the court handled the case in a "slipshod" manner and disposed of it in just three hours.

Sharif's party said it would consult with its lawyers before deciding how to proceed. However, Sharif's insistence that the Supreme Court is illegitimate without the fired judges could make it politically difficult for him to appeal.

Zehra, the analyst, said the ruling raised questions about the independence of the court, which could work to Sharif's benefit.

"The net effect of this will be more pressure on Zadari and the PPP to restore the judiciary," she said.

Musharraf ousted Sharif in a 1999 military coup, forcing him into exile for eight years. Sharif returned in November to lead his party into the elections.

Since then, Sharif has repeatedly demanded Musharraf's impeachment, accusing the former army chief of running the country as a dictatorship although the president has taken a back seat in politics as the new civilian government has assumed control.

Though Sharif's party finished second in February elections to Zardari's, a recent poll showed him to be far and away the most favored politician in the country and indicated his party had become Pakistan's most popular.