Iftikhar Mohammed Chaudhry, the chief justice whose attempted removal by Musharraf spurred much of the political turmoil that ultimately led to the president's downfall last year, headed the 14-member bench that delivered the ruling on Friday.

Mass detentions

Musharraf was elected to a new term as president in October 2007 while still head of the army, but the result was not validated by the supreme court.

The president's lawyers had said he would stand down as army chief once re-elected, but Musharraf declared a state of emergency the following month when it appeared the supreme court might challenge his eligibility for office.

The constitution was subsequently suspended and Chaudhry fired as chief justice.

The emergency, which was accompanied by mass detentions and harsh media restrictions, enraged an already emboldened opposition and was lifted after six weeks.

Summons ignored

Eventually, under domestic and international pressure, Musharraf allowed elections that brought his foes to power in February 2008.

Musharraf, who stepped down as president in August 2008 under threat of impeachment, is currently staying in London.

He 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.