The restoration of top judges two years after their dismissal will give Pakistan desperately needed rule of law and marks up a victory for opposition leader Nawaz Sharif , analysts said. Hours before a planned march by lawyers and opposition parties was due to descend on Islamabad, the government Monday caved into public pressure and agreed to reinstate the judges and end a repressive crackdown on activists. Prime Minister Yousuf Raza Gilani, in a dawn address to the nation, announced that all judges including chief justice Iftikhar Chaudhry sacked by former military ruler Pervez Musharraf would resume office from March 21. The decision came after a series of meetings he and army chief General Ashfaq Kayani held with President Asif Ali Zardari to avert bloodshed and instability in the frontline US ally in the "war on terror". Main opposition leader Sharif , a former prime minister who galvanised opponents of Zardari and led thousands of protestors in a march out of Lahore, hailed the announcement and promptly called off a mass protest. The government's climbdown was widely seen as a product of Western pressure on Zardari to defuse the standoff with Sharif , and Gilani's orders to release hundreds of people in detention as a victory for rights. "I think it's a huge victory for civil society, lawyers and Nawaz Sharif ," defence and political analyst Talat Masood said. "It came too late but it came before (the protestors reached) Islamabad" and averted expected clashes. "Sharif took a firm stand, his stature has gone up," he said. "For the first time in Pakistan's history, an independent judiciary will be there to strengthen the rule of law." "It will also help counter radicalism and extremism." US officials were seen as instrumental in trying to encourage Zardari and Sharif to end their standoff. Masood said Americans played a "very positive" role. "They have understood that Sharif 's party is an important political force in Pakistan and there is no need to have any confrontation. Their role was very constructive." Jaffer Ahmed, director of the Pakistan Study Centre at Karachi University, described the agreement as a major step forward for the country, but slammed Zardari for miscalculating at every stage. "President Zardari lost a good opportunity to take ownership of the lawyers movement. Nawaz Sharif captured it and emerged as a big leader," he said. "Sharif's right-wing party has become popular and the secular Pakistan People's Party is weakened. It is alienated by the civil society, because of Zardari's wrong policies and wrong advisers," he said. "Sharif demonstrated leadership qualities, he is more articulate and consistent while Zardari has no experience in taking decisions at the right moment and his advisers also lack experience. Zardari's camp miscalculated the extent of their unpopularity and the depth of feeling that Sharif incited in politically strategic Punjab province, which controls around 60 percent of seats in parliament. "They did not realise the movement carried Punjab with it. Sharif won the battle on Sunday when barricades in Lahore were broken," Ahmed said. Masood also lauded the prime minister, saying that Gilani adopted a different position to Zardari, despite government insistence of a united front. "Gilani emerged as a better politician, who has better understanding of the pulse of the people. This will help the parliamentary system function," the commentator said. But analysts warned that the political victory must not be abused. "It should not become a permanent feature because religious and sectarian groups may now feel that decisions can be achieved on streets and they may also stage marches to get their demands approved," said Ahmed.