Sharif and other lawmakers were able to enter the building through a back exit connected to the heavily guarded premier's office after the protesters late Tuesday had torn down barricades and entered the so-called Red Zone housing Parliament and other key government buildings.

The twin protests led by the famous cricketer-turned-politician Imran Khan and the cleric Tahir-ul-Qadri have virtually shut down Islamabad, raising fears of unrest in the nuclear-armed U.S. ally with a history of military coups and dictatorship.

Despite the mounting pressure, Sharif has refused to step down, while the country's powerful army has called for a negotiated settlement.

“Situation requires patience, wisdom and sagacity from all stakeholders to resolve prevailing impasse,” army spokesman Gen. Asim Saleem Bajwa said on Twitter. He said the government buildings in the so-called Red Zone were a “symbol of state” protected by the army.

Pakistan TV showed Sharif entering the National Assembly, or lower house of parliament, and meeting with lawmakers from all the major parties except Khan's Pakistan Tehreek-e-Insaf, the legislature's third largest bloc.

Lawmakers from several parties condemned the protesters' attempt to besiege Parliament.

“We will foil this conspiracy, and we will defend our democratic institutions,” said Maulana Fazlur Rehman, head of the Jamiat Ulema-e-Islam party and a Sharif ally.

Shazia Marri, a lawmaker from the opposition Pakistan People's Party, condemned the move to surround Parliament, saying: “We will strive to safeguard democracy. We will strive for the supremacy of the constitution.”

Outside the Parliament, Qadri directed his supporters to occupy all the main gates of the building and not to allow Sharif or any other deputies to leave until the prime minister resigns.

“We deliberately gave these lawmakers a chance to enter the Parliament, but now we will not allow any lawmaker to go inside or come out,” he said.

Khan had warned Tuesday that his supporters would enter the premier's office if Sharif does not step down by the following evening, but on Wednesday his party appeared to back down, urging supporters not to enter government buildings and indicating it would take part in talks to resolve the crisis.

“We are ready for the talks. We will present our six demands when we hold any such talks,” senior party official Shah Mahmood Qureshi told a Pakistani news channel. Khan, however, has repeatedly said he will only hold talks with the government after Sharif's resignation.

The Supreme Court, acting on a petition, summoned Khan and Qadri over the sit-ins, ordering them to appear before a judge either in person or through their attorneys, according to Pakistan TV.