The Pakistan government has agreed to reinstate chief justice Iftikhar Chaudhry to end a political crisis.
President Asif Ali Zardari had previously stonewalled calls from the opposition led by former prime minister Nawaz Sharif and a lawyers' movement to restore the judge.
Mr Chaudhry was dismissed in late 2007 by then-president Pervez Musharraf, but Mr Zardari regarded the judge as too politicised and feared he could pose a threat to his own presidency if restored.
The announcement follows a spate of anti-government protests in Lahore.
Mr Sharif said the government had turned the country into a police state as he defied government attempts to thwart the so-called long march protest and called supporters on to the streets.
Hundreds of protesters, many of them members of the Jamaat-e-Islami religious party, hurled stones at police outside the High Court in Lahore. Several vehicles were torched.
Police responded with tear gas and baton charges.
Later thousands of opposition activists flooded the area despite a government ban on rallies and the police retreated.
The protest campaign by anti-government lawyers and opposition parties threatens to bring more turmoil to Pakistan as the government struggles to combat Islamist militants and revive a flagging economy.
Earlier, Mr Sharif's party said he had been ordered detained at his home for three days.
Police in riot gear sealed off Mr Sharif's house with road blocks but government officials denied he had been placed under house arrest. One official said Mr Sharif had been placed under ‘protective security’ for three days.
Police have detained hundreds of lawyers and opposition activists in a crackdown to foil the nationwide protest that is due to climax with a sit-in outside parliament in Islamabad tomorrow.
The government has put troops on alert.