Opponents derided the proceedings — which will keep the Pakistani leader in power as president until 2007 — as a tattered fig-leaf barely obscuring his continued military rule.
The balloting in both houses of parliament and the nation's four provincial assemblies followed a surprise deal last month with a coalition of hardline Islamic parties that agreed to support Musharraf's claim to the presidency in return for a promise that he step down as army chief by the end of 2004.
Information Minister Sheikh Rashid Ahmed said the vote — which Musharraf won easily because of a walkout by several key opposition groups — was an important boost ahead of a regional summit that will bring Pakistani and Indian leaders together for their first face-to-face meetings since relations between the two rivals began to thaw in April.
The seven-nation summit begins in the capital on Sunday.
"Now Musharraf can greet the summit delegates as the elected president of Pakistan," Ahmed told The Associated Press. When asked if Thursday's confidence vote meant the end of a dictatorship begun after Musharraf seized power by force in a 1999 coup, Ahmed said: "Yes, you could say that."
But Thursday's drama did little to put to rest the debate swirling around the general, who has become one of the United States' staunchest allies in the war on terrorism even as he has sidelined his country's other political heavyweights. Two former prime ministers, Benazir Bhutto and Nawaz Sharif, live in exile.
During voting in the lower house, opposition lawmakers from Bhutto's Pakistan Peoples Party and Sharif's Pakistan Muslim League banged on their desks, shouting "No, No, No! Go, Musharraf, Go!"
Lawmakers from both parties walked out of proceedings at assemblies throughout the country.
Ahsan Iqbal, the chief coordinator of the Pakistan Muslim League, called the vote a "mockery of democracy."
"Musharraf has staged another drama to get his illegal presidency validated," he told AP. "It is a total fraud. We don't accept these results. We do not accept him as president."
Even lawmakers from the Islamic coalition — called the Mutahida Majlis-e-Amal, or MMA — remained on the sidelines, neither supporting nor opposing the general in the confidence vote.
The holdouts made for some strange numbers.
The 100-member Senate voted 56-1 in favor of Musharraf, while the 342-member lower house voted 191-0 for the general. Provincial voting followed the same lines, with the large number of abstentions most notable in the North West Frontier Province, a deeply religious area bordering Afghanistan where the Islamic coalition holds sway.
Musharraf won the North West Frontier Province vote unanimously, but only 30 of the province's 124 lawmakers in the assembly took part.
Had Musharraf lost the confidence vote he would have been forced to resign, though that was never considered a possibility after his supporters reached a deal with the Islamic coalition, a marriage of convenience for the strongly pro-American leader and the virulently anti-American religious bloc.
Under the deal, Pakistan's 1973 constitution was amended this week to give Musharraf extraordinary powers — including the right to dissolve parliament and sack the prime minister by decree.
In return, Musharraf agreed to the religious coalition's main demand: that he leave the army post, which is the source of most of his power, by Dec. 31, 2004.
Before the deal, opposition lawmakers had paralyzed parliament for months, shouting down speakers and banging on their desks.
Musharraf remains the most powerful figure in Pakistan, though he has handed over day-to-day handling of the country to the prime minister, a political ally.
The general survived two assassination attempts in December, the last a dual suicide car bombing near his army residence in Rawalpindi, a city near the capital, Islamabad. Musharraf was unhurt, but 16 people were killed and dozens injured.
Jaish-e-Mohammed, a Pakistani militant group with ties to the more radical elements of the Islamic political coalition, is believed to have been behind that attack.
By Paul Haven