A single member bench of the Sindh High Court accepted 69-year-old Musharraf's request for extension of bail, which was granted before he arrived back in the country.
The court, however, ordered the former president not to leave the country without taking its permission. The pre-arrest bail serves to prevent his arrest for past charges.
While coming out of the court complex, Musharraf was shoed by a lawyer. Angry scenes were witnessed and people, including groups of lawyers, shouted slogans against him.
The shoe hurled allegedly by advocate Tajammul Lodhi in the corridor did not hit Musharraf and he was escorted safely out of the court by security personnel. Lodhi was detained and taken to an undisclosed location, the Geo TV reported.
More From This Section
This was not the first time that a shoe was hurled at Musharraf. In 2011, a man tried to hurl his shoe at him when the Pakistani leader was addressing a gathering in Britain.
Musharraf had arrived in the court through VIP entrance but as soon as news spread of his presence, the lawyers started protesting and tried to enter the chamber of the Chief Justice. There were scuffles between lawyers and policemen.
The high court had also granted Musharraf a pre-arrest bail in the Baloch nationalist leader Akbar Bugti and former prime minister Benazir Bhutto murder cases.
Musharraf, who seized power in 1999 and left Pakistan after stepping down in 2008, is also wanted in the country for conspiracy to murder and illegally arresting judges.
Musharraf, who formed political party All Pakistan Muslim League, intends lead his party in the May 11 polls.