With opposition parties boycotting the election, Musharraf received an overwhelming majority of the votes cast by federal and provincial politicians.
The opposition argued that it was unconstitutional for an outgoing parliament to choose a new president and that Musharraf was disqualified under a bar on public servants seeking elected office.
Kamal Hyder, Al Jazeera's correspondent in Islamabad, said: "Thousands of opposition supporters have gathered outside the court."
Musharraf has promised to resign from his army job before beginning a new five-year presidential term.
His term and that of parliament expire on November 15.
It is unclear when the nine-member panel of judges will rule on the case, which has injected more uncertainty into Pakistan's already turbulent politics.
Wednesday's court hearing in Islamabad coincided with an announcement by Bhutto that she would leave for the Pakistani city of Karachi the next day to begin her campaign for parliamentary elections due by January.
"My return heralds for the people of Pakistan the turn of the wheel from dictatorship to democracy, from exploitation to empowerment, from violence to peace," she said at a news conference in Dubai, in the United Arab Emirates.
"Pakistan needs a military leader who can control both civil and possible military extremism"
Creative_person01, Islamabad, Pakistan
Send us your views
Hyder said, however, that many Pakistanis were not happy with her agreeing a power-sharing deal with Musharraf.
"Such talk is not likely to go down well with many people in Pakistan," he said.
Musharraf has held talks with Bhutto that could see them form an alliance after the elections are complete.
The supreme court is also examining the legality of an amnesty signed by Musharraf that quashed corruption cases against her and others and paved the way for her return from eight years of self-exile.
Officials had urged Bhutto to delay her return because of the legal uncertainties.
Few, though, expect that she will face the same treatment as Nawaz Sharif, another exiled former premier who was swiftly deported to Saudi Arabia when he tried to return last month.
The supreme court is to hear later a petition from Sharif later on Wednesday, arguing that he should be allowed to return.