ISLAMABAD, Pakistan - Pakistan's two main opposition parties announced Thursday they would form a new government together, but skirted the issue of whether they would push for the ouster of U.S.-backed President Pervez Musharraf.

The agreement between the secular groups, which tussled over power for a decade before Musharraf seized control in a 1999 coup, marks an important step toward setting up a civilian administration to govern Pakistan after years of military rule.

Asif Ali Zardari, husband of slain former premier Benazir Bhutto, and Nawaz Sharif, whose last government was ousted by Musharraf, made the announcement after meeting in Islamabad.

"We have agreed on a common agenda. We will work together to form a government together in the center and in the provinces," Sharif told reporters. He said a smaller group, the Awami National Party, would join them.

"The future of democracy is within our grasp. We will strengthen the parliament, we will strengthen democracy, we will work together for Pakistan. We will make a stronger Pakistan," Zardari said.

Bhutto's Pakistan People's Party won 87 National Assembly seats in Monday's election, and Sharif's Pakistan Muslim League-N won 67 out of the 268 contested seats. The pro-Musharraf Pakistan Muslim League-Q got 40, with the rest going to smaller parties and independent candidates. Six seats have yet to be announced.

The election exposed Musharraf's lack of public support amid rising Islamic militancy and anger over his crackdown on the judiciary. It also raised questions about his survival as head of state. He recently resigned his dual post of military commander, considerably diminishing his power.

While both parties rode a wave of anti-Musharraf sentiment, they still have to hammer out the details of how they will share power and resolve their differing policies.

Sharif has been far sterner in demanding Musharraf's ouster and in seeking the reinstatement of the chief justice, one of dozens of independent-minded judges sacked by the president in November just as the Supreme Court was to rule on the legality of his re-election by parliament.

In what appeared to be a face-saving formula, Sharif told reporters that he and Zardari agreed in principle on restoration of the judges, but would leave it to parliament to sort out the details.

"In principle there's no disagreement on restoration of the judiciary. We will work on the modalities in parliament," he said.

A few hours earlier, Sharif had made an impassioned address to protesters at the Islamabad home of deposed chief justice Iftikhar Mohammed Chaudhry, demanding his release and restoration to the court, which is now stacked with Musharraf appointees.

The party leaders did not make explicit whether they would push for Musharraf's removal, but Sharif reiterated his desire for the president to go.

"I think the nation today has given out its verdict and that verdict is amply clear, and it is from every nook and corner of Pakistan. He also understands that. The sooner he accepts the verdict the better it is for him," Sharif said.

Musharraf, a key ally of Washington in its war on terrorist groups, has said he has no intention of resigning and will serve out his five-year term.

However, many Pakistanis see Musharraf as a divisive figure whose continued presence could lead to political confrontation and destabilize the new government.

White House press secretary Dana Perino said it was up to the Pakistanis "to decide whether Musharraf retains his position." But State Department spokesman Sean McCormack said U.S. officials also are telling opposition forces that moderates should work together to fight extremists and move toward democracy.

Last year, the U.S. and Britain pushed for rapprochement between Bhutto and Musharraf. The two held talks, paving the way for Bhutto's return from self-exile amid hopes they could form a pro-Western alliance and galvanize the campaign against the Taliban and al-Qaida.

The negotiations collapsed before Bhutto's Dec. 27 assassination, but Zardari has not ruled out working with Musharraf.

One of the first tasks of the new government, which is expected to be installed by mid-March, will be determining how to fight Islamists. The country has been hit by dozens of deadly attacks blamed on Muslim militants in recent months.

Both opposition parties have considered negotiating with the extremists rather then relying on military force.

Zardari said the new government's first act will be to ask the United Nations for help in uncovering who was behind his wife's killing.

U.S. and Pakistani officials have accused Taliban leader Baitullah Mehsud of masterminding the assassination, but many Pakistanis suspect Pakistani intelligence services may have been involved.