Pakistan's two main opposition parties have agreed to form a coalition government after they won the most seats in Monday's general election.
The two leaders say the sacked chief justice must be reinstated
Former Prime Minister Nawaz Sharif said he had agreed "a common agenda" with the party of assassinated opposition leader Benazir Bhutto.
He had been in talks with Ms Bhutto's widower, Asif Zardari, the new leader of the Pakistan People's Party (PPP).
Such a government could put renewed pressure on President Pervez Musharraf.
"We will work together to form the government in the centre and in the provinces," Mr Sharif, head of the Pakistan Muslim League - Nawaz (PML-N), said at a joint news conference with Mr Zardari.
He said the two parties had agreed that the country's chief justice, sacked by President Musharraf in November, should be immediately reinstated.
Mr Zardari said there was "a lot of ground to cover" between the two parties, but "in principle, we have agreed to stay together".
Doubts remain about who will emerge as a possible prime minister.
Mr Zardari has ruled himself out for the role, despite his party's success at the election.
He has said his PPP party will choose another candidate to lead a coalition government.
Mr Zardari, a deeply divisive figure in Pakistani politics who has spent several years in prison on corruption charges, is not an MP and is therefore not currently eligible to serve as prime minister.
The party backing President Musharraf, the PML-Q, and its coalition partners have now lost their majority in parliament and Mr Zardari said none of them would be invited into the new governing coalition.
He also said one of the first tasks for the new government, once it was sworn in, would be to ask for UN help in investigating the assassination of his wife, Benazir Bhutto, killed while campaigning in December.
Together, Mr Zardari's and Mr Sharif's parties have more than half of the new parliament's seat. If they can form a grouping with a two-thirds majority, they could call for Mr Musharraf to be impeached.
Mr Sharif has been deeply critical of the president and says he wants "to rid Pakistan of dictatorship forever".
Mr Musharraf has said he will not resign or retire, but instead wishes to work towards stable democratic government in Pakistan.
Mr Musharraf seized power from then-Prime Minister Nawaz Sharif in a military coup in 1999 and was re-elected to the presidency in October in a parliamentary vote boycotted by the opposition as unconstitutional.