ISLAMABAD, Pakistan -- Pakistan's parliament on Thursday rejected calls for Prime Minister Nawaz Sharif's resignation as unconstitutional despite massive anti-government protests just outside the assembly in the capital Islamabad.

The resolution, supported by nearly every opposition party, marked a defeat for cricketer-turned-politician Imran Khan and popular cleric Tahir-ul-Qadri, who have led weeklong protests from the eastern city of Lahore to the gates of parliament calling for Sharif's ouster over alleged voting fraud.

The assembly rejected the protesters' demands for Sharif's resignation and the dissolution of parliament, vowing to "uphold the supremacy of the constitution" and the "sovereignty of the parliament."

The U.S. Embassy appeared to support the assembly, saying "we strongly oppose any efforts to impose extra-constitutional change," while encouraging the parties to "resolve differences through peaceful dialogue in ways that strengthen Pakistan's democratic institutions and rule of law."

Khan accused Washington of taking sides in a speech before protesters, telling it not to back "stooges like Nawaz Sharif." Khan's Pakistan Tehreek-e-Insaf, the third largest party in parliament, was not present for the vote.

The protests have been peaceful, but have raised tensions in the nuclear-armed country of 180 million people with a history of political turmoil and military dictatorships. Sharif's election last May marked the first democratic transfer of power since Pakistan was carved out of India in 1947.

After a request from the country's powerful military the government convened talks with Khan and Qadri's representatives early Thursday.

Shah Mahmood Qureshi, a senior leader of Khan's party, told reporters that in addition to Sharif's resignation, the opposition demanded electoral reforms, setting up a caretaker government, removing top election officials and accountability for anyone found to have rigged last year's elections.

Khan later pulled out of the talks, however, saying the appointment of a new police chief in Islamabad was a precursor to a crackdown on the protests. It was not immediately clear if Qadri would also withdraw from the talks.

The government denied it had any plans to confront the protesters, and insisted it was willing to discuss all issues except Sharif's resignation.

"We want to carry forward the talks," Information Minister Pervaiz Rashid said.

Sharif was forced from office after a previous stint as premier in 1999, when the then-army chief Pervez Musharraf seized power in a coup.