Hours before filing papers in Lahore, Mr. Sharif vowed that he would never be a part of any coalition government serving under President Pervez Musharraf.
Mr. Sharif flew into Lahore Sunday from Saudi Arabia, where he spent the past seven years in exile. He is the latest opposition figure to return to Pakistan ahead of today's registration deadline for election candidates.
Speaking to a large and enthusiastic crowd at the airport, Mr. Sharif said he returned home to save the country, and he denounced the state of emergency decreed by General Musharraf as an obstacle to free elections.
Mr. Sharif said democracy must be restored, and he called for reinstatement of Pakistan's deposed Supreme Court justices.
His rival in the days before General Musharraf seized power, Benazir Bhutto, filed her nomination papers for the election on Sunday.
Mr. Sharif's Pakistan Muslim League and Ms. Bhutto's Pakistan People's Party are both part of an opposition coalition that is considering a boycott of the January elections if emergency rule is not lifted beforehand.
Mr. Sharif was Pakistan's last elected civilian leader before General Musharraf took power in a coup in 1999. The ousted prime minister was tried and sentenced to life in prison, but then allowed to go into exile in return for his promise to stay out of Pakistan for 10 years.
Mr. Sharif tried to return to Pakistan in September but was deported within hours. This time, government officials say he will be allowed to remain.
Some information for this report was provided by AFP, and AP.