Pakistan's ruling party conceded defeat to the opposition Tuesday in parliamentary elections that could threaten the rule of President Pervez Musharraf, a key American ally in the war on terror.

The party of former Prime Minister Nawaz Sharif, who was ousted in Musharraf's 1999 coup, scored a stronger-than-expected showing with a campaign that called for Musharraf's ouster. After the vote, he called for the president to step down.

"We accept the election results, and will sit on opposition benches," Chaudhry Shujaat Hussain, head of the ruling Pakistan Muslim League-Q, told AP Television News. "We are accepting the results with grace and open heart."

The results cast doubt on the political future of Musharraf, who was re-elected to a five-year term last October. With the support of smaller groups and independent candidates, the opposition could gain the two-thirds majority in parliament needed to impeach the president.

Sen. Joseph Biden, a Democrat who chairs of the Senate Foreign Relations Committee and one of several U.S. lawmakers who observed the election, said the results mean the United States can shift its Pakistan policy.

"This is an opportunity for us to move from a policy that has been focused on a personality to one based on an entire people," Biden said, adding that Washington should encourage more deeply rooted democracy in Pakistan.

Although fear and apathy kept millions of voters at home Monday, the elections for national and provincial assemblies were a major step toward democracy in Pakistan, which has been under military rule for the past eight years under Musharraf and for over half of its 60-year history.

A win by the opposition is likely to restore the public's faith in the political process and quell fears that the results would be rigged in favor of the pro-Musharraf forces.

The private Geo TV network said the party of slain former Prime Minister Benazir Bhutto and another group led by Sharif had so far won 153 seats, more than half of the 272-seat National Assembly.

The ruling party was a distant third with 38 seats and a number of party stalwarts and former Cabinet ministers lost in their constituencies.

"All the king's men gone!" proclaimed a banner headline in the Daily Times.

Final results were not expected before Tuesday evening but the election's outcome appeared to be a stinging public verdict on Musharraf's leadership. His popularity had plummeted following his decisions late last year to impose emergency rule, purge the judiciary, jail political opponents and curtail press freedoms.

Sharif reminded reporters Tuesday in Lahore that Musharraf had said he would step down when the people wanted him to do so.

"And now people have given their verdict," Sharif said, adding that political parties should "work together to get rid of dictatorship."

The president has angered many Pakistanis by allying the country with Washington in 2001 to fight Al Qaeda and the Taliban after the Sept. 11 attacks in the United States.

The White House declined to comment until the final results were announced.

Musharraf has promised to work with whatever government emerges from the election. But the former general is hugely unpopular among the public and opposition parties that have been catapulted into power are likely to find little reason to work with him — particularly because he no longer controls the powerful army.

Sharif has been especially outspoken in demanding that Musharraf be removed and that the Supreme Court justices whom the president sacked late last year be returned to their posts. Those judges were fired as they prepared to rule on whether Musharraf's re-election last October was constitutional.

If the opposition falls short of enough votes to remove Musharraf, the new government could reinstate the Supreme Court justices and ask them to declare the October election invalid.

Musharraf, at best, faces the prospect of remaining in power with sharply diminished powers and facing a public hostile to him. Last year he stepped down as army chief, and his successor has pledged to remove the military from politics.

The results could have far-reaching implications for the U.S.-led war on terror, especially Pakistani military operations against Al Qaeda and Taliban-style militants in border areas of the northwest.

Sharif and others have called for dialogue with the extremists and have criticized military operations in the area because of their impact on civilians.

Geo TV said unofficial tallies from 229 of the 268 National Assembly seats being contested showed Bhutto's Pakistan People's Party with 33 percent and Sharif's Pakistan Muslim League-N party with 27 percent. The PML-Q was third with 14 percent.

The Election Commission had results for 124 seats, with Sharif's party holding 30 percent, Bhutto's party 27 percent and the PML-Q 12 percent.

The chairman of the ruling party, the foreign minister and railways minister were among those who lost seats in Punjab, the most populous province and a key electoral battleground.

Religious parties fared badly, and were set to lose their control of the North West Frontier province gained in the last parliamentary elections in 2002, when they benefited from Pakistani anger over the U.S.-led invasion to topple the Taliban in Afghanistan.

Afrasiab Khattak, a leading opposition politician from the northwest, said his Awami National Party did not believe "that a military solution will work," adding his group "will never support American forces coming here and operating."

The Awami National Party, a Pashtun nationalist group, was leading in the northwest with 30 of the 99 contested assembly seats while Bhutto's party was trailing second with 15. The party of pro-Taliban cleric, Maulana Fazl-ur Rehman, won only eight seats, according to a tally reported by the Geo TV station.

In Karachi, the Pakistani stock market rose 2.15 percent and the rupee strengthened against the U.S. dollar. Traders said the market was reacting positively because the election was generally peaceful.

Islamic militant violence scarred the campaign, most notably the Dec. 27 assassination of charismatic opposition leader Bhutto. But there were no major attacks on election day. The government, however, confirmed 24 election-related deaths in clashes between political parties.