The main party backing President Pervez Musharraf has admitted defeat in Pakistan's elections.
The two main opposition parties, the PPP of late PM Benazir Bhutto and the PML-N, led by another former PM, Nawaz Sharif, have a clear majority.
If they form a coalition with a two-thirds majority in parliament they could impeach Mr Musharraf.
The BBC's Chris Morris in Islamabad says Mr Musharraf has never looked weaker than he does today.
The full scale of the defeat inflicted on the pro-Musharraf PML-Q will become clearer during Tuesday as more results come in.
NATIONAL RESULTS SO FAR
PPP (Bhutto's party) : 87
PML-N (Nawaz Sharif): 66
PML-Q: (pro-Musharraf) 38
MQM (Sindh-based): 19
ANP (Secular Pashtuns): 10
Source: Geo TV
Whether the PPP and the PML-N decide to work together in a coalition remains to be seen. Our correspondent says there is a great deal of political bargaining to come.
Unofficial and provisional results show big gains for Mr Sharif and Ms Bhutto's parties.
According to the website of the Geo private TV station, the PPP leads the tally with 87 seats, with the PML-N following with 66 seats.
This gives the two opposition parties a combined total of 153 seats in the parliament with some seats still to be declared.
PML-N leader Nawaz Sharif said on Tuesday that he hoped to work with other opposition parties to rid Pakistan of what he described as a dictatorship.
The pro-Musharraf PML-Q was a distant third, with 38 seats.
The chairman of the pro-Musharraf PML-Q party, Chaudhry Shujaat Hussain, told Associated Press Television News his party accepted the results "with an open heart" and was prepared to "sit on opposition benches".
Several notable ministers in the government had lost their seats, while dramatic gains were made by some smaller parties.
In the North West Frontier Province, the Awami National Party, which campaigns for Pashtun nationalism, has defeated the Islamist incumbents.
Most official counts will not be declared until later on Tuesday.
Speaking earlier, Mr Musharraf had said: "The result will be the voice of the nation and whosoever wins we should accept it - that includes myself," said Mr Musharraf.
Though he did not stand in the parliamentary election himself, correspondents say the clear defeat of his supporters has made his position more precarious.
President Musharraf has been a major US ally in the "war on terror" but his popularity has waned at home amid accusations of authoritarianism and incompetence.
His forces have been trying to contain a Taleban-influenced Islamist insurgency along the country's rugged frontier with Afghanistan.
The election has been preceded by months of violence, including the suicide attack that killed PPP leader, Ms Bhutto, in December.
The poll was initially scheduled for early January but was delayed after her assassination.
Supporters of the PPP and PML-N were celebrating in the streets on Tuesday.
Leaders of both opposition parties had earlier warned the polls would be rigged in favour of the government.
HAVE YOUR SAY
I hope that this election is a positive step towards democracy, peace and economical growth
Atif Majid, Kuwait
The next government will have to decide how it chooses to work with a president who has never had much time for politicians with broad popular support, our correspondent says.
Pakistani newspapers spoke of a "rout" of Mr Musharraf's allies, with The News proclaiming: "Democracy takes revenge."
One of Pakistan's top lawyers who has been under house arrest for several months said he could already sense a wind of change after the election.
Aitzaz Ahsan told the BBC his police guards had left and his telephone landline had been reconnected.
He warned that the country's lawyers may resume street protests if controversial Chief Justice Iftikhar Muhammad Chaudhry, who was sacked in a row with Mr Musharraf, was not re-instated within weeks.
Mr Musharraf seized power in a bloodless coup in 1999.
International pressure forced him to step down as army chief last year and the parliamentary election has been viewed as a key milestone along Pakistan's path from military to civilian rule.
Fear of violence
At least 20 people are reported to have died in election-day violence, with the PPP reporting 15 of its members killed.
There were also some reports of missing ballot boxes.
But there was also widespread relief that there were none of the major bomb attacks which had marred the run-up to the election.
Fears of violence had dissuaded many of the country's 80 million eligible voters from leaving their homes, and voter turnout was estimated to be less than 40%.
Close to half a million security personnel, including about 80,000 soldiers, had been deployed to quell any outbreak of violence.