ISLAMABAD, Pakistan  Pakistanis dealt a crushing defeat to President Pervez Musharraf in parliamentary elections on Monday, in what government and opposition politicians said was a firm rejection of his policies since 2001 and those of his close ally, the United States.

Almost all the leading figures in the Pakistan Muslim League-Q, the party that has governed for the last five years under Mr. Musharraf, lost their seats, including the leader of the party, the former speaker of Parliament and six ministers.

Official results are expected Tuesday, but early returns indicated that the vote would usher in a prime minister from one of the opposition parties, and opened the prospect of a Parliament that would move to undo many of Mr. Musharraf’s policies and that may even try to remove him.

Image Pakistani supporters of the Muttahida Qaumi Movement party, MQM, react after the closing of the polls in Karachi, Pakistan. Credit... David Guttenfelder/Associated Press

Early results showed equal gains for the Pakistan Peoples Party, whose leader, Benazir Bhutto, was assassinated on Dec. 27, and the Pakistan Muslim League-N, the faction led by Nawaz Sharif, like Ms. Bhutto a former prime minister. Each party may be in a position to form the next government.