Dozens of supporters of Imran Khan, the cricketer-turned politician, held a separate protest outside the court.
"Pakistan needs a military leader who can control both civil and possible military extremism"
Creative_person01, Islamabad, Pakistan
Send us your views
Both groups filed petitions to the court challenging the legality of Musharraf's eligibility to stand in the elections due to his dual role as civilian and military chief.
The court is expected to rule early next week.
Kamal Hyder, Al Jazeera's correspondent in Islamabad said although there was a heavy police deployment outside the court there were no "untoward incidents".
"We will not tolerate Musharraf. We will continue our campaign against him," Hanif Abbasi, an MP, told protesters.
"We will not tolerate him in or out of uniform."
After several hours, the protesters dispersed peacefully.
In the eastern city of Multan, about 400 people rallied and burned a portrait of Musharraf. In Karachi, police detained about a dozen opposition supporters to prevent a planned protest going ahead.
A few dozen people also rallied in Quetta, Peshawar and Lahore.
Meanwhile, an alliance of opposition parties has said all its members will resign from the national and provincial assemblies on September 29.
Hyder said: "There is still some confusion because a little while ago there were more reports, coming form the leader of the oposition, Maulana Fazlur Rehman saying that he was not consulted."
The alliance does not include the Pakistan People's Party of Benazir Bhutto, a former prime minister.
Bhutto, who has been in power-sharing talks with Musharraf, has said her members might also give up their seats if Musharraf did not take steps to restore democracy.
An opposition boycott would not derail the vote but would detract from its legitimacy.
An electoral college comprising all federal and provincial lawmakers is to choose the next president on October 6. Parliamentary elections are due to follow by mid-January.
Musharraf indicated on Tuesday that he would step down as head of the army if he is re-elected president, a move which would ostensibly restore civilian rule eight years after he took power.
|"We will not tolerate him |
in or out
Hanif Abbasi, an opposition MP
Opposition parties say that for him to contest the election while remaining as head of the military would violate the constitution.
Musharraf reshuffled his senior military staff on Friday, appointing a new military intelligence chief.
Nadeem Taj was director-general of the Inter-Services Intelligence (ISI), and promoted him from major-general to lieutenant-general.
Taj was formerly the head of military intelligence and also served as Musharraf's military secretary after he came to power in a bloodless coup eight years ago.
The move will increase expectations that the replaced ISI chief, Lieutenant-General Ashfaq Pervez Kiani, will get one of the top jobs - either replacing Musharraf as chief of army staff, or becoming his vice chief.
Al Jazeera's Kamal Hyder said the new appointments will be closely monitored.
"It will be interesting to see if this is a prelude to Musharraf announcing a successor before the election," he said.