Final results from this week's parliamentary poll were expected later Wednesday, but with the count nearly complete, two opposition parties have won enough seats to form a new government, though they will likely fall short of the two-thirds needed to impeach the president.
The result is seen as a major political setback for Musharraf, a key ally of Washington in fighting Taliban and al-Qaida, whose popularity has plummeted over the past year. The victors were secular political parties; Islamic hard-liners fared badly.
Bush, the Pakistani leader's chief foreign backer, declared Wednesday that the elections were a "victory in the war on terror."
"There were elections held that have been judged as being fair, and the people have spoken," Bush said in Ghana during his current trip to Africa.
"It's now time for the newly elected folks to show up and form their government," Bush said. "The question then is 'Will they be friends of the United States?' I certainly hope so."
European Union monitors said the election went better than expected, but conditions during the campaign period favored the ruling party.
So far, the parties of two former Pakistani prime ministers, the slain Benazir Bhutto and Nawaz Sharif, have garnered 154 of the 268 contested seats, according to the Election Commission. The various parties already have begun discussions on forming a coalition government, likely to be led by Bhutto's party.
The new government, expected to be installed by mid-March, will determine how to tackle the country's formidable challenges, including rising prices and the threat from Islamic extremism.
Pakistan's new leaders also must decide how to deal with Musharraf, who seized power in a 1999 coup and went on to become a key ally in the U.S. war on terror, an unpopular decision in the Muslim nation of 160 million.
Musharraf's spokesman Rashid Qureshi said Tuesday the president intends to work with the new government and will serve out his term that expires in 2012 rejecting opposition calls for him to resign.
"The people on Monday didn't vote to elect a new president," he said. "In fact, they participated in the elections to elect the new parliament."
But Musharraf's decisions to suspend the constitution, purge the judiciary and round up political opponents sent his approval ratings plummeting, and the sound defeat suffered by the pro-Musharraf party was widely seen as a repudiation of the president.
Sharif, who already has called on the president to resign, said Wednesday: "I think Musharraf should understand that the situation is out of his control."
Sharif is expected to meet shortly with Asif Ali Zardari, leader of Bhutto's Pakistan Peoples Party, which won the most seats and is now discussing with various political leaders the possibility of forming a broad-based coalition government.
A spokesman for Sharif's Pakistan Muslim League-N party said it would support Zardari to form a "stable government" although it would not seek positions in the Cabinet.
"We only want them (Bhutto's party) to reinstate judges and roll back constitutional changes made by Musharraf," said the spokesman, Sadiq ul-Farooq.
Sharif's demand to restore judges sacked by Musharraf could leave him at odds the PPP, which says Parliament should decide the issue.
Sharif's party may focus on controlling the largest province of Punjab, where it won the most seats in the provincial assembly, and play a less active role in a federal government led by the PPP, which has not ruled out working with the president.
In an interview with The Wall Street Journal posted Tuesday on the newspaper's Web site, Musharraf confirmed he intends to remain in office and work with the new government.
"We have to move forward in a way that we bring about a stable democratic government to Pakistan," he said.
He agreed the election outcome was a reflection of Pakistanis' dissatisfaction with his government, citing economic problems and his attempt to rein in judges as well as sympathy for the opposition after the assassination of their charismatic leader, Bhutto.
"All these things had a negative impact," Musharraf said.
Zardari told reporters Tuesday he wanted to form a "government of national unity." He made clear that he would not include politicians who had been allied with Musharraf, but carefully avoided an unequivocal statement about whether the president should remain in power.