Musharraf’s presidential election victory confirmed following Pakistan court ruling.
Sharif went into exile in Saudi Arabia shortly after being forced from power by Musharraf in a bloodless coup in 1999.
He was greeted by thousands of cheering supporters at Lahore airport as he returned to the country on Sunday.
State of emergency
Sharif said he could still boycott the elections scheduled for January 8 unless Musharraf lifts the state of emergency imposed on November 3 and withdraws an order suspending the constitution.
“I would like to reiterate my conviction that martial law and dictatorship are not in the country’s interest,” he said.
Their replacements recently endorsed the re-election of Musharraf as president for another term.
The military has said that the president will hang up his uniform on Wednesday before taking the oath for a second five-year presidential term on Thursday.
“President Musharraf will take the oath as a civilian president on the 29th and he will pay farewell visits to various military headquarters on the 27th and 28th,” Rashid Qureshi, Musharraf’s spokesman, told the AFP news agency.
Earlier, Pakistan’s attorney-general said that the former prime minister could be barred from standing in the election.
“As the election law stands today, it is highly doubtful that Nawaz Sharif can contest elections,” Malik Mohammad Qayyum told Dawn News television.
Qayyum said he would probably be banned because he had been sentenced to life imprisonment before he went into exile in 2000.
The deadline to file nomination papers for the election was midnight on Monday.
Dozens of supporters showered Sharif with rose petals as he arrived at a courtroom in Lahore where candidates were registering for the poll.
His brother Shahbaz also filed nomination papers.
Benazir Bhutto, another former prime minister and opposition leader, filed nomination papers for a second time on Monday saying she was prepared to join with Sharif.
“We are ready to forge an alliance with all moderate political parties,” she told reporters in Larkana, her family’s ancestral home in rural southern Pakistan.
“We welcome Nawaz Sharif’s return to Pakistan. It will strengthen the democratic and political culture.”
Under Pakistani law, candidates can stand in more than one place, but can only represent one seat, forcing a by-election in the seat they renounce.
An alliance between the two former prime ministers could cause major problems for Musharraf and secure defections from the president’s ruling party.
But Musharraf’s willingness to allow Sharif to return may indicate that the president hopes to split the opposition vote.
Bhutto herself flew home last month after eight years abroad, and both have suggested they are considering boycotting the elections.
“We are concerned that elections will be rigged but we don’t want to leave the field empty,” Bhutto said.
Sharif said that a boycott remained “a very potent option for the opposition”.
“We don’t want to boycott elections, but if you push somebody to the wall, then what are the options left?” he said.