Formal and final results may take one or two days, but a forceful voter rebuke to the president, a close U.S. ally, could have broad repercussions for Pakistan's role in confronting the Taliban and Al Qaeda.
Unofficial tallies suggested that two of the president's closest allies lost what were considered bellwether races.
One was former Cabinet minister Sheikh Rashid Ahmed, who conceded in his district in Rawalpindi, outside the capital. The party president of the ruling Pakistan Muslim League-Q, Chaudhry Shujaat Hussain, also appeared to have lost his seat in Punjab, the country's most populous and politically influential province.
In contrast, the Pakistan People's Party, or PPP, of assassinated former Prime Minister Benazir Bhutto appeared to have performed strongly, particularly in her native Sindh province, along with the Pakistan Muslim League-N of former Prime Minister Nawaz Sharif, which appeared poised to take Punjab.
Drum-beating celebrations broke out before dawn in cities including Karachi and Rawalpindi. Supporters of the two main opposition parties danced in the streets and waved party and Pakistani flags, while the headquarters of ruling party candidates were dark and silent.
Private Pakistani TV stations said that by midmorning today, unofficial tallies had been compiled for about two-thirds of the 272 parliamentary seats being contested.
Geo television said Sharif's party had edged out Bhutto's, with the two main opposition parties garnering more than 60% of the vote between them. The pro-Musharraf party trailed with about 12%.
Reports suggested that turnout had hit a historic low, about 35%, according to Sarwar Bari of the nonprofit Free and Fair Elections Network. Many voters were kept away from the polls by fear of violence.
In addition to the nationwide vote for parliament, ballots were cast for regional assemblies. In a striking turnaround, an alliance of religious parties appeared to have lost control of the volatile North-West Frontier Province, a hot spot for fighting between government forces and Islamic militants.
Scattered election-related violence killed at least 24 people and injured scores of others, but the polls closed without a major attack.
The campaign had been scarred by a series of suicide bombings, including the assault that killed Bhutto on Dec. 27.
Public opinion surveys taken before the election suggested that Bhutto's PPP would win the largest share of votes, followed by Sharif's party, with the Musharraf- allied ruling party trailing.
Despite fears of violence or vote-rigging, a slow and steady procession of Pakistanis trekked to polling stations throughout the day.
Turbaned tribal elders, urban sophisticates in designer sunglasses and sinewy laborers wearing dusty sandals emerged from polling stations with ink-stained thumbs and, in many cases, smiles of quiet satisfaction.
"My vote is a message to Musharraf -- that he should go," college student Adil Javed said.
The president, speaking on state television, said he would give "full cooperation" to whichever party won.
But an opposition-dominated parliament could move to impeach him, or to invalidate his controversial election to another term by lawmakers late last year.
Pakistan's illiteracy rate ranges up to 70% in the countryside, so the ballots were marked with sometimes-fanciful symbols for each party -- a bicycle, an arrow, a candle. Supporters of Sharif were irked when some provincial assembly ballots rendered his party symbol as a house cat rather than a tiger.
Tensions ran high in the North-West Frontier Province, where preelection violence was concentrated, including a bombing on the last day of campaigning that killed nearly 50 people.
Islamic militants distributed pamphlets saying religious precepts forbade women to vote, and many, particularly in religiously conservative areas, stayed home. Nonetheless, in some of the tribal areas bordering Afghanistan, women were allowed to cast votes for the first time.
Not only women were affected by the intimidation; some entire clans decided to stay away.
"For me, life is more important than a vote," said Akbar Khan, a supporter of Bhutto's party in the provincial capital, Peshawar. "Our family has decided that nobody will cast a vote."
But many others across the country said they were voting in Bhutto's memory, or as a show of support for Sharif, a former prime minister who was overthrown and exiled by Musharraf.
A delegation from the European Union was the largest single group of outside election monitors. Several prominent U.S. lawmakers were among the international observers.
Sens. John F. Kerry (D-Mass.), Chuck Hagel (R-Neb.) and Joseph R. Biden Jr. (D-Del.), the chairman of the Senate Foreign Relations Committee, visited two polling stations in the eastern city of Lahore. Although they praised some of the polling procedures designed to ensure an honest vote, Kerry also expressed concern over the dozens of violent incidents that had been reported by early afternoon.
As he flipped through page after page listing assaults, shootings and attempted grenade attacks, he told U.S. Ambassador Anne W. Patterson: "No suicide bombings, but that's a lot of incidents. . . . I wouldn't turn out" to vote.
"It's disturbing to see that much violence," he told reporters.
"It's intimidating people from coming to the polls. . . . It's not a great atmosphere."
Kerry said the U.S. would be watching the election outcome closely and that American support for Pakistan could be revisited if massive fraud was detected. Critics have already expressed strong skepticism over the fairness of the vote.
Kerry and Biden said they would be surprised if the ruling party won the parliamentary majority that Musharraf and his allies have predicted. Based on reports from observers, a win by the Musharraf-allied party "would send up alarm bells," Biden said.
"If the elections aren't fair, I will move to cut off a significant amount of aid," Biden said. "For the next 10 years, our economic assistance is unconditional. Our military assistance isn't."
On election day, critics of Musharraf were determined to remind one and all of the crackdown late last year, during which the president suspended the constitution, arrested thousands of opponents and fired dozens of judges, including Supreme Court Chief JusticeIftikhar Mohammed Chaudhry.
Under Chaudhry, the high court had appeared poised to invalidate Musharraf's election by lawmakers to a second term as president.
Supporters of the deposed chief justice gathered Monday by a barricade leading to his home, where he and his family have been confined since Nov. 3, the day Musharraf issued an emergency decree that ushered in six weeks of de facto martial law.
Lines of blue-uniformed police watched from behind rolls of barbed wire as opposition lawyer Athar Minhallah declared that Musharraf's move against the judiciary all but ruled out a fair vote.
"The elections were rigged on Nov. 3," he said.
Others in the legal community still confined to their homes include Aitzaz Ahsan, the former head of the Supreme Court Bar Assn. His wife, Bushra, said she felt torn about casting a ballot, fearing it would give the election a stamp of legitimacy. But a rigged election could inspire street violence, she said.
"People will not take it lying down. Enough is enough . . . Everything is happening because of one man who refuses to let go of the power he illegally has assumed," she said after a luncheon in Lahore with the visiting American lawmakers.
Another prominent activist who met the U.S. delegation, human rights campaigner Asma Jahangir, urged the Bush administration to show "zero tolerance for dictatorship." Jahangir was under house arrest during the emergency rule.
Some voters said the effective dismantling of Pakistan's independent judiciary was the main issue that propelled them to the polls despite their anxieties.
Said Peshawar resident Mohammed Waseem: "I am casting a vote for the restoration of deposed judges."
King reported from Islamabad and Chu from Lahore. Special correspondent Zulfiqar Ali contributed from Peshawar.