Pakistan's main opposition groups are trying to put aside their rivalries in order to form a two- thirds majority in parliament to challenge President Pervez Musharraf's rule.
A wave of sympathy helped the Pakistan People's Party of assassinated former Prime Minister Benazir Bhutto emerge as the largest party in the 342-seat National Assembly, although it failed to win a majority.
A hostile parliament could seek to oust Musharraf, who came to power in a coup in 1999 and is accused of violating the constitution when he imposed six weeks of emergency rule in November to secure five more years as president.
Asif Ali Zardari, Bhutto's widower, said the PPP had the right to form a coalition government, adding there would be no place in it for the pro-Musharraf Pakistan Muslim League (PML).
Zardari, who took over the leadership of the PPP after Bhutto's death, said he would try to persuade Nawaz Sharif, the prime minister Musharraf overthrew, to join a coalition.
Speaking at a news conference in Lahore, Sharif urged Musharraf to accept he was no longer wanted.
Bhutto's assassination in a suicide attack on December 27 heightened concern about the stability of the nuclear-armed Muslim state, where al Qaeda leaders have taken refuge.
Groups of opposition supporters celebrated in the streets across the country as results emerged.
The pro-Musharraf Pakistan Muslim League trailed a distant third. The party's spokesman conceded defeat after the voters' verdict but kept alive chances of joining a coalition.
"They have rejected our policies and we have accepted their verdict," PML's Tariq Azim Khan said, adding: "We're willing to cooperate and work with anybody."
Washington said it welcomed the poll as a step towards full democracy and hoped a new government could work with Musharraf, considered a bulwark against al Qaeda in its "war on terror".
The pro-Musharraf PML trailed with 38. Small parties and independents shared the others.