ISLAMABAD, Pakistan (CNN) -- All judges sacked by Pakistan's previous president, including Chief Justice Iftikhar Muhammad Chaudhry, will be reinstated, Prime Minister Syed Yusuf Raza Gilani announced Monday, triggering celebrations in major cities after days of massive demonstrations.
Iftikhar Muhammad Chaudhry is shown speaking on his mobile phone Monday in Islamabad.
"As per my commitment and the commitment of [President] Asif Ali Zardari, I announce the reinstatement of all deposed judges," Gilani said in an address that bowed to protesters' demands.
Chaudhry will replace Justice Abdul Hameed Dogar, who retires on March 21.
In addition, Gilani said the government was seeking a review of a court ruling last month that disqualified opposition leader Nawaz Sharif and his brother from public office and ensnared the country in a political crisis.
Gilani also said protesters arrested during the past few days will be released.
"I think it is a great day for democracy and for Pakistan that not only has political polarization been avoided, but an elected government has very correctly responded to the voice of the people," said former Information Minister Sherry Rehman.
The U.S. State Department said the move "brought Pakistan back from the brink." Watch how a crisis was averted for now »
U.S. Secretary of State Hillary Clinton telephoned Zardari at the weekend, while Special Representative Richard Holbrooke and Ambassador to Pakistan Anne Patterson spoke with Pakistani leaders.
Acting State Department spokesman Robert Wood insisted Clinton made no demands or threats, but she did stress U.S. concern over the political chaos in Pakistan and Washington's desires for a peaceful outcome.
A senior State Department official told reporters Clinton warned Pakistani leaders the political turmoil had the potential to impact Pakistan's efforts on the war on terrorism, which could in turn impact U.S. aid to Islamabad.
Clinton's "friendly advice," the official said, was "You've got to get this situation under control."
Rehman resigned in protest this past weekend after the government shut down privately owned Geo TV in many parts of the country Saturday. Some outages remained on Monday, with the channel's signal being blocked in certain areas, while other cable operators still carried it.
Geo TV is one of the nation's most popular television channels, and its coverage has been critical of the government, which is led by the Pakistan Peoples Party.
Rehman, who was a key member of the PPP, said her resignation came when the party broke its word on media freedoms. "We have always fought for media freedom in the blackest days of dictatorship and anti-democratic rule in the country," Rehman told CNN on Monday.
Government officials instructed cable operators to remove Geo TV from the airwaves or push it farther down in the channel order, according to Azhar Abbas, managing director of the station.
Repeated phone calls from CNN to the Pakistani government for comment were not returned.
Hundreds of lawyers held protests over the past week between Karachi and Islamabad, which demonstrators had planned to cap with a sprawling sit-in at the parliament building in Islamabad on Monday.
Following Gilani's announcement, the lawyers' movement canceled its demonstration.
The demonstrators, which included civil rights and political activists in addition to lawyers, touted different causes during their protests but were united by one common grievance: dissatisfaction with Asif Ali Zardari's government.
The political turmoil in Pakistan comes just a year after the country celebrated a return to democracy. It has forced the government's attention away from a deadly fundamentalist insurgency in its tribal areas and an economy that's on the verge of collapse.
CNN's Reza Sayah and Zein Basravi contributed to this report.