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 husband, Asif Zardari, the new leader of the Pakistan People's Party (PPP).
Such a government could put renewed pressure on President Pervez Musharraf.
'Lot of ground'
"We will work together to form the government in the centre and in the provinces," Mr Sharif, head of the Pakistan Muslim League (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.
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.
If Mr Zardari's and Mr Sharif's parties can form a grouping with a two-thirds majority, they could call for Mr Musharraf to be impeached.