Pakistan's Supreme Court ruled Friday that former President Pervez Musharraf's imposition of emergency rule in 2007 was unconstitutional, state and private media outlets reported.

Details were still coming to light, but the ruling could invalidate the appointments of judges made by Musharraf in the six weeks after he suspended the constitution on Nov. 3, 2007.

It also may strengthen the case for bringing treason charges against the former military ruler, further jolting Pakistan's political establishment at a time when the U.S. wants it to focus on battling a Taliban insurgency.

The 14-member bench that delivered the ruling was headed by Chief Justice Iftikhar Mohammed Chaudhry, whose attempted ouster by Musharraf spurred much of the political turmoil that ultimately led to the former army chief's downfall.

Musharraf, a longtime U.S. ally, declared the emergency when it appeared the Supreme Court might challenge his eligibility for office. The emergency — which was accompanied by mass detentions and harsh media restrictions — enraged an already emboldened opposition. It was lifted after six weeks.

Eventually, under domestic and international pressure, Musharraf allowed elections that brought his foes to power in February 2008. Under threat of impeachment, he stepped down in August 2008.

Ever since, many opponents have demanded he be held accountable.

Musharraf, who is staying in London, ignored a summons to appear before the court or send a lawyer this week to explain his actions. In the past, he has defended the moves as being in the interest of the country.

The court's announcement Friday was eagerly awaited by many Pakistanis, especially lawyers who led a movement that helped push Musharraf out of office. Many gathered at various locations across the country to await news of the ruling. Afterward, they danced in the streets and cheered.

Musharraf seized power in a 1999 military coup and became a key ally in the U.S.-led war against al-Qaida following the Sept. 11, 2001, attacks that sparked the American-led invasion of neighboring Afghanistan.

In early 2007, Musharraf dismissed Chaudhry as chief justice. That triggered mass protests led by lawyers that damaged Musharraf's popularity.

The court managed to bring Chaudhry back, but — faced with growing rancor and fearing he could be ousted — Musharraf declared the emergency, tossing out Chaudhry and around 60 other judges. That only deepened popular anger against the military ruler.

Under domestic pressure, and prodding from the U.S., Musharraf lifted the emergency, stepped down as army chief and allowed parliamentary elections to take place the following February.

The elections brought his political foes to power, but even after Musharraf's resignation, the fate of the judges, especially that of Chaudhry, caused fissures among those who came to power.

A coalition government consisting of Asif Ali Zardari's Pakistan People's Party and Nawaz Sharif's Pakistan Muslim League-N fell apart over the slow pace of reinstating the ousted jurists.

Ultimately, facing escalating lawyer-led protests reminiscent of Musharraf's era, now-President Zardari agreed to reinstate Chaudhry — whom he'd viewed as too political a figure — in March.

Ever since, there have been rumblings in some corners about whether Musharraf would have to answer in court for his actions, and court petitions were filed over the issue.

Some argue that holding Musharraf accountable would deter military strongmen from trying to seize power in the future and give a chance for democratic institutions to grow in a country that has spent about half its existence under army rule.

The flip side is that pursuing Musharraf could shake the political establishment and reopen old wounds at a time when Pakistan faces huge tasks in battling Taliban insurgents and reviving its economy.