A Pakistani court on Tuesday imposed a lifetime ban on former President Pervez Musharraf from contesting elections, derailing his efforts to regain influence by winning a seat in parliament.
It was the first time a court in Pakistan had declared a citizen ineligible from contesting elections for life.
The former army chief returned last month after nearly four years of self-imposed exile to contest a May 11 general election, but election officers disqualified him because of court cases pending against him.
The High Court in the northwestern city of Peshawar rejected Musharraf's appeal against the disqualification. Court Chief Justice Dost Mohammad Khan imposed the lifetime ban on running for election or becoming a member of the parliament.
"The former dictator had ordered senior judges and their families be put under house arrest and twice abrogated the country's constitution," Khan said when reading out the order.
Instead of triggering a hoped-for groundswell of popular support, Musharraf's return has backfired. He became the first former army chief to be arrested in Pakistan when police took him into custody at their headquarters last Friday.
On April 20, a court remanded the former president in custody for two weeks, a deadline set to expire on May 4, as judges pushed ahead with plans to put Musharraf on trial for a crackdown on the judiciary during his time in office.
On Tuesday, an anti-terrorism court in the garrison city of Rawalpindi put Musharraf on a 14-day judicial remand for charges of failing to provide adequate security for former prime minister Benazir Bhutto before her 2007 assassination.
The new deadline of May 14 means Musharraf will be in detention on election day.
The elections are seen as a key moment in Pakistan's attempts to shake off a legacy of decades of military rule as they represent the first time a democratically elected civilian government has completed a term in office.
Former Prime Minister Nawaz Sharif, the man Musharraf ousted in a coup in 1999, is seen as the front runner.
Musharraf also faces accusations in connection with the death of a separatist leader in the southwestern province of Baluchistan. He denies any wrongdoing.
The current chief justice, Iftikhar Chaudhry, was embroiled in a confrontation with Musharraf, who removed him from office in 2007 after he opposed plans to extend the general's stay in power. He was later reinstated.
The military has ruled Pakistan for more than half of its 66-year history, through coups and from behind the scenes. It sets foreign and security policy, even when civilian administrations are in power.
But current commanders have meddled less in politics, letting civilian governments take the heat for policy failures.