ISLAMABAD, Pakistan — The Supreme Court on Friday ruled that the emergency rule briefly imposed by former President Pervez Musharraf two years ago was illegal and unconstitutional.

In a widely anticipated verdict, a 14-member bench of the Supreme Court, headed by Chief Justice Iftikhar Muhammad Chaudhry, declared null and void all acts taken by Mr. Musharraf during the emergency period, declared from Nov. 3 to Dec. 15, 2007.

In a separate decision, the court also ruled illegal the appointment of all judges inducted during the period. The ruling will affect more than 100 judges in the higher and lower courts, the Dawn television network reported.

The judges include Abdul Hameed Dogar, who was sworn in as chief justice when Mr. Musharraf dismissed Mr. Chaudhry under the emergency decree. The court declared that the dismissal of Mr. Chaudhry was unconstitutional. Mr. Chaudhry was in any case restored as chief justice under a political deal struck in March.

The court said, however, that its ruling would not affect the oath taken by President Asif Ali Zardari, which Justice Dogar had administered.

Mr. Musharraf was not at the hearings and has been living in London. Some political analysts said the rulings could open the way for further legal challenges against the former president, a onetime general who took power in a coup, including whether he could be tried for treason.

Legal experts said the Supreme Court could not initiate treason charges on its own. “It is up to the federal government to initiate charges against Musharraf,” said Athar Minallah, a prominent lawyer.

But the civilian government, already absorbed in an expanding battle against Taliban insurgents in the country, may want to avoid antagonizing the military, which is likely to resist any effort to put Mr. Musharraf on trial. For now, the government and Parliament will have to decide on what to do with more than three dozen ordinances that Mr. Musharraf promulgated during the emergency period.

Even before the ruling on Friday, Chief Justice Chaudhry made clear this week that the court would bend toward a decision that would seek to avoid sowing more chaos in the country.

Babar Sattar, a constitutional lawyer based in Islamabad, called the court’s ruling “a very principled decision.”

“It has interpreted the Nov. 3 action strictly according to the Constitution,” he said.

Arif Rafiq, a political analyst, agreed. “The Supreme Court of Pakistan is reasserting its constitutional space and institutional integrity by cleansing itself of the vestiges of dictatorship,” he said. “But its political challenge appears to be limited.”

Farahnaz Ispahani, the media adviser to Mr. Zardari, hailed the decision as a “victory for democracy.” Describing the decision as the last nail in the coffin of dictatorship, Ms. Ispahani emphasized that it would block any future attempts to topple a democratic government by any army general.
But some voiced disagreement.

“The decision is difficult to justify in terms of transitional justice because it doesn’t state why the court is beginning the task of correcting unconstitutionality in 2007 and not 2002, when military rule began,” said Rafia Zakaria, a columnist for The Daily Times, a leading English newspaper.