LAHORE, Pakistan — The Pakistani government agreed early on Monday to reinstate the independent-minded former chief justice of the Supreme Court, a stunning concession to the opposition leader Nawaz Sharif, who had been heading toward the capital in a convoy threatening to stage a mass protest over the issue after he broke free from house arrest at his residence near here.

The concession, broadcast on national television by Prime Minister Yousaf Raza Gilani, came after a tumultuous weekend in Pakistani politics in which a dispute between President Asif Ali Zardari and Mr. Sharif escalated into a crisis that was destabilizing nuclear-armed Pakistan, already under pressure from a growing Islamic insurgency and severe economic troubles.

The decision to restore the chief justice, Iftikhar Muhammad Chaudhry, came after calls to Mr. Zardari and Mr. Sharif, including from Secretary of State Hillary Rodham Clinton, asking them to ease their differences.

The Obama administration’s special envoy to Pakistan, Richard C. Holbrooke, said the United States applauded “the statesmanlike act by President Zardari and hope that it will help defuse a dangerous confrontation so that Pakistan, with the help of its many friends, can address the nation’s pressing and urgent needs.”