Musharraf has faced paltry public support, a raft of legal challenges and Taliban death threats since he returned to Pakistan last month after years in self-imposed exile.
Many experts predicted Musharraf's fate and have been scratching their heads at what drove his decision to return. Some have speculated he misjudged how much public backing he would get, while others guessed he was simply homesick.
A judge in the remote northern district of Chitral had given Musharraf some rare good news in approving his bid to run in the May 11 election, even though Musharraf was disqualified in three other districts for suspending the constitution and sacking senior judges while ruling Pakistan.
Pakistan allows a candidate to run for multiple seats simultaneously.
Lawyers challenged the Chitral decision and the high court in the main northwestern city of Peshawar disqualified him Tuesday, said two of the lawyers who raised objections, Taufiq Asif and Rao Abdur Rahim.
Asif challenged Musharraf's candidacy because of his actions while in power, while Rahim said there were procedural flaws with the former military ruler's nomination.
Aasia Ishaq, a spokeswoman for Musharraf's All Pakistan Muslim League party, condemned the court's ruling and said the entire process was biased.
"They are just targeting Pervez Musharraf," Ishaq said.
She said the party would appeal the decision to the Supreme Court and field candidates for nearly 200 national and provincial assembly seats even if Musharraf is disqualified.
Ashraf Gujar, a Pakistani constitutional expert, said he thought there was only a "remote" chance that the Supreme Court would overturn the ruling.
Musharraf seized power in a military coup in 1999 and ruled for nearly a decade before he was forced to step down in 2008. He came back to Pakistan last month to stage a political comeback after four years in self-imposed exile in London and Dubai.
But it has been a bumpy return.
Only a couple thousand people turned out at the airport in the southern city of Karachi to greet the former military strongman when his plane from Dubai landed on March 24, a sign of how little support analysts say he enjoys in the country. A few days later, an angry lawyer threw a shoe at Musharraf as he walked through a court building in Karachi.
Musharraf faces a variety of legal charges, including some related to the 2007 assassination of former Prime Minister Benazir Bhutto. He has not been arrested because he arranged pre-arrest bail before he arrived, a feature of Pakistan's legal system.
The Supreme Court is also hearing petitions from lawyers alleging Musharraf committed treason while in office, an offence that can be punished by death or life in prison. He has been barred from leaving the country while there are legal challenges against him.
Amid all of this, the Pakistani Taliban have threatened to assassinate Musharraf. The militants released a video the day before Musharraf returned to Pakistan saying they had set up a special death squad to target him.
There is also concern that attacks by the Taliban and other militants could hamper next month's election.
On Tuesday, a suicide bomber targeting members of an anti-Taliban political party in northwestern Pakistan killed 16 people and wounded over 40, police and hospital officials said.
The bomb exploded as key members of the Awami National Party were arriving for a meeting in the city of Peshawar, said police officer Zahir Shah. The party members included Ghulam Ahmad Bilour and his nephew Haroon Bilour, whose father was one of the most senior ANP leaders and was killed in a suicide attack in December
Ghulam Ahmad Bilour was slightly wounded in his leg, said Jamil Shah, a spokesman for Lady Reading Hospital in Peshawar.
Among the 16 dead were six policemen and 10 civilians, including three children and a journalist, said Peshawar police chief Liaqat Ali Khan.
Pakistani Taliban spokesman Ahsanullah Ahsan claimed responsibility. "These (attacks) are the bitter fruit the ANP has to pluck from the tree of secularism they have planted," Ahsan told The Associated Press by telephone from an undisclosed location.
The Pakistani Taliban have specifically threatened the ANP and two other secular parties, the Pakistan People's Party and the Muttahida Quami Movement, in the run-up to parliamentary elections.
Also Tuesday, a bombing in the country's southwest hit a convoy of vehicles carrying an election candidate from a different party, killing four people and wounding six others, said Pakistani officials.
Sardar Sanaullah Zehri's convoy was passing over a bridge in Baluchistan province's Khuzdar district when a bomb was detonated by remote control, said local government official Abdul Sattar Mengal.
Zehri, the Baluchistan president of the Pakistan Muslim League-N party, was unharmed, but his brother, son and nephew were killed, along with a driver, said Megal.
Baluchistan is home to both Islamic militants and nationalists who have been waging an insurgency against the government for decades, seeking greater autonomy and a larger share of the province's natural resources.
In Pakistan's northwestern tribal region, an army vehicle hit a roadside bomb Tuesday, killing four soldiers and wounding four others, said intelligence officials. The attack took place near Miran Shah, one of the main towns in the North Waziristan tribal area, the principal sanctuary for Taliban militants in the country.
Also in the tribal region, a U.S. drone fired two missiles at a suspected Pakistani Taliban compound before dawn Wednesday, killing four alleged militants, intelligence officials said. The strike took place in the Bhobar, part of the South Waziristan tribal area, also a major sanctuary for the Taliban.
The intelligence officials all spoke on condition of anonymity because they were not authorized to talk to the media.
Associated Press writers Abdul Sattar in Quetta, Pakistan, Rasool Dawar in Peshawar, Pakistan, Ishtiaq Mahsud in Dera Ismail Khan, Pakistan, and Zarar Khan and Munir Ahmed in Islamabad contributed to this report.