Tahirul Qadri ends four-day mass protest after Zardari's government agrees to give his movement a say in naming a caretaker government before elections.

ISLAMABAD, Pakistan — The firebrand cleric who led a massive street rally aimed at bringing down the Pakistani government called off the protests Thursday after negotiating a settlement with ruling coalition leaders.

The agreement between religious scholar Tahirul Qadri and government officials ended a four-day standoff that threatened to upend the country's political landscape.

It calls for the antigovernment movement to have a say in appointing a caretaker prime minister to run the country leading up to elections this year. It does not, however, force the immediate resignation of President Asif Ali Zardari and his officials, an administration derided by critics as incompetent and rife with corruption.

Late Thursday, Qadri appeared before legions of supporters and announced that their resolve had paid off.

"I congratulate you! God has given you a victory!" Qadri told the crowd while flanked by members of the coalition, some of them government ministers. "This will be a historic chapter in Pakistan's history."

Zardari's information minister, Qamar Zaman Kaira, who a day earlier had called protesters' demands unrealistic and unconstitutional, embraced Qadri in front of the crowd and lauded him for leading a peaceful march.

"Today is a victory for democracy, a victory for the people of Pakistan," Kaira told the crowd.

Qadri was largely a forgotten figure on Pakistan's political scene when he returned to his home country in December after spending six years in Canada, and vowed to sweep away corrupt political leaders before national elections in May.

On Sunday, he led a large caravan of buses and vans filled with demonstrators from the eastern city of Lahore to the capital, Islamabad, and a day later set up the sit-in demonstration about 500 yards from the parliament.

For four days, the demonstrations riveted the nation and paralyzed the capital. Schools shut down, many businesses closed and avenues leading to the city's enclave of government buildings known as the red zone were blocked by cordons of freight containers, barbed wire and police in riot gear.

Qadri's movement received a boost Tuesday when the Supreme Court ordered the arrest of Prime Minister Raja Pervez Ashraf on corruption charges stemming from a scandal during his days as water and power minister. On Thursday, however, Fasih Bokhari, the head of the National Accountability Bureau, the government's anti-corruption agency, told the high court that he did not have enough evidence to warrant Ashraf's arrest. Chief Justice Iftikhar Mohammed Chaudhry ordered Bokhari to issue a complete report on the case Jan. 23.

Leaders in Zardari's ruling Pakistan People's Party, or PPP, as well as many analysts, suspected that the country's powerful military, which has had an adversarial relationship with Zardari's team, may have quietly been directing Qadri's movement in hope of commandeering the caretaker government that will be established in the two-month period before the election. Both Qadri and the military have denied that contention.

Qadri issued several demands to Zardari's administration during the protests, including the establishment of a preelection caretaker government appointed with input from the military. Under Pakistan's constitution, the PPP and the main opposition party — former Prime Minister Nawaz Sharif's PML-N — have joint power to appoint the caretaker prime minister and Cabinet.

Qadri argued that allowing the PPP and the PML-N to set up the caretaker government would pave the way for them to manipulate the election and retain power. The PML-N governs Punjab, the country's most populous province. But many observers saw Qadri's demand as a vehicle for the military to, as it has numerous times in Pakistan's history, wrest oversight of the country from a civilian government.

Without military intervention, Zardari's government would become the first to complete a five-year term and hand over control to another civilian administration through elections.

Under the compromise Qadri and the government reached, the PPP and the PML-N will still appoint a caretaker prime minister, but after consulting with Qadri's party, the Awami Tehrik. Qadri also sought the replacement of Pakistan's election commission, which he said was biased in favor of the ruling party, with a new roster of nonpartisan members. That issue remains unresolved, though both sides agreed it would be taken up again this month by the government and a team of lawyers.

Qadri's message resonated with many Pakistanis deeply frustrated by the inability of Zardari's government to remedy crippling power outages, rejuvenate the economy and turn the tide against homegrown militancy.

Many demonstrators said that despite having to sleep in the cold on blankets spread on asphalt, they were willing to keep the protest alive until Qadri gave them the go-ahead to leave. They listened closely each day as he gave long, fiery speeches from an armchair behind protective glass and inside a freight-car-sized steel box.

After Qadri's announcement of the agreement, demonstrators danced in the street and chanted Qadri's name.

Waseem Iqbal, 27, a tailor from Rawalpindi, said it didn't matter that Zardari's government was still in place.

"This isn't partial success, it's total success," Iqbal said. "My hope now is that the next government we elect is corruption-free."