Musharraf, due to address the nation later on Thursday, made no mention of lifting the state of emergency. U.S. President George W. Bush on Wednesday urged him to end emergency rule before the elections.
Musharraf won re-election in a vote by legislators on October 6. He later suspended the constitution, declared emergency rule and purged the Supreme Court to block opposition legal challenges to his victory while still a serving officer.
Sharif told reporters on Wednesday Musharraf's oath of office had no legitimacy and he demanded the reinstatement of judges sacked under the emergency.
In Lahore, about 250 lawyers in black suits tried to push their way past police who fought them back with batons outside the city's main court. Both sides hurled bricks at each other.
"We don't accept Musharraf even without his uniform. He has to go," said lawyer Malik Mohammad Arshad, his eye swollen and head bleeding after begin hit by a brick.
Lawyers have led widespread opposition to Musharraf since he tried to dismiss the chief justice in March.
Musharraf, who cited rising militancy when he imposed the emergency, said the military had "broken the back of the spread of terrorism" from remote tribal lands on the Afghan border towards urban population centres.
"We have to defeat terrorism, there is no choice," he said, hours after five soldiers were killed by a roadside bomb near the Afghan border.
As a military band struck up the national anthem, Musharraf snapped to salute before quickly lowering his arm, apparently remembering he was now a civilian.
Many ordinary Pakistanis say it is time he left politics.
"I don't consider him to be the president. After taking oath as president eight years ago, what has he done? Nothing," said Ali Imran, a 30-year-old government servant in Lahore.
"What we want is a democracy like India."
Pakistani stock investors, happy to see Musharraf sworn in and hopeful the emergency would soon be lifted, pushed the main index 0.58 percent higher. Investors like Musharraf's liberal policies that have brought strong growth, dealers said.

















