Musharraf plans to step down as army chief on Wednesday and take the oath of office as a civilian president on Thursday, according to his spokesman.
The opposition's key demand since Musharraf took power in a bloodless military coup in 1999 and declared himself president was that he shed his military uniform. And now that he is poised to do so, the main opposition party leaders have signed up to run in the Jan. 8 parliamentary elections, rather than boycott them.
Musharraf's support from the general public began to wane when he suspended Chief Justice Iftikhar Mohammed Chaudhry in March. The government said it was investigating charges of misconduct against Chaudhry, which he denied. The Supreme Court reinstated Chaudhry by the summer.
Then, after Musharraf easily won re-election in October, in a contest the opposition largely boycotted, his dual military and presidential role was again called into question, this time by the Supreme Court.
As the court was considering his legitimacy as a candidate despite his win, Musharraf abruptly dismissed Chaudhry and several other judges, saying the action was necessary to run the government unencumbered and fight Islamic militants.
Pakistan, a critical front on the war on terrorism, has received $10 billion in aid from the United States since the Sept. 11, 2001 terrorist attacks.
Pakistani Ambassador to the United States Mahmud Ali Durrani explained on the Nov. 7 NewsHour that the Supreme Court had "gone beyond its mandate," for example, releasing 61 suspected terrorists.
The Supreme Court, under Chaudhry, had been pursuing the cases of about 200 people who had been held in secret since 2001 with no trials. One of the detainees, a Pakistani man suspected of aiding al-Qaida, Muhammad Naeem Noor Khan, was released to his home in Karachi -- much to the dismay of American and British officials -- after his case was brought before the high court for review.
The court also ruled that former Prime Minister Nawaz Sharif, who had been in exile since his ousting in the 1999 coup, could return to Pakistan. After a failed attempt to return in September, when he was deported to Saudi Arabia four hours after his airplane landed, he successfully re-entered the country on Sunday and has registered to run in the upcoming elections.
Two-time former Prime Minister Benazir Bhutto, who leads the largest opposition group, the Pakistan People's Party, also returned to Pakistan in October, after eight years of self-imposed exile. Her aim was to work on a power-sharing agreement with Musharraf.
But when Musharraf declared a state of emergency and suspended the constitution weeks later, violent clashes between police and protesting lawyers and activists ensued, leading to the arrest of hundreds. Bhutto herself was put under house arrest for several days in Lahore, where she refused to talk to Musharraf and began demanding his resignation.
Lahore police said the move was necessary for her protection. The day Bhutto returned to Pakistan, a suicide bomber attacked her convoy and killed more than 100 people, though she escaped unharmed.
Musharraf continued to insist the state of emergency was temporary but necessary for fair elections in January.
Rumblings from opposition groups again indicated a possible boycott of the elections. Liaqat Baloch, one of the leaders of Pakistan's Islamic party Jamaat-e-Islami, said his organization was strongly considering such a boycott. He told the Associated Press, "If there is an emergency and no constitution, it is impossible to have free and fair elections."
Bhutto reached out to other opposition leaders, including her former rival Sharif, head of the Pakistan Muslim League, and former cricket star-turned-politician Imran Khan, leader of the Tehreek-e-Insaf party, about forming an alliance to try to oust Musharraf.
Deputy Secretary of State John Negroponte visited the country in mid-November and pressed Musharraf to lift emergency rule, saying elections wouldn't be fair unless opposition leaders, lawyers and others were released from jail.
"If steps were taken by both sides to move back toward the kind of reconciliation discussions they were having recently, we think that would be very positive and could help improve the political environment,'' he said, according to the AP.
By the end of November, the Supreme Court made up mostly of Musharraf's allies, dismissed the challenges to his re-election. And Pakistan's election commissioner set elections for Jan. 8.
Musharraf has maintained that the state of emergency, which has enabled authorities to clamp down on demonstrations and shut down independent media outlets, is keeping the country from sliding into chaos. "I cannot watch this country go down in front of me after so many achievements and such an economic turnaround," he said on state-run television, according to the AP.