Thirteen years after he was removed as premier, arrested and humiliatingly sent into exile to Saudi Arabia, Sharif has declared victory in the historic general elections.
In many ways, analysts say, Sharif's return reflects the slow and steady maturing of democracy and politics in Pakistan, which has been run by the military for more than half of its 66-year history.
And it is Sharif's relationship with the powerful military, which sets the agenda for foreign and security policies, that will largely determine the country's future.
The PML-N is now comfortably placed to form a coalition government, setting up an unprecedented third term as premier for Sharif.
More From This Section
Sharif is set to return to power at a time when Pakistan is facing several major challenges, including growing extremism, a strong Taliban presence in the country's northwest, rampant corruption, uneasy relations with the US ahead of the withdrawal of foreign forces from war-torn Afghanistan and an economy that has virtually been in free fall for the past few years.
After conducting nuclear tests in response to India's atomic blasts in 1998, Sharif had worked with his then Indian counterpart Atal Bihari Vajpayee to improve relations.
Talking to the media last night, Sharif said he worked hard for a detente with New Delhi before Musharraf deposed him.
"We'll pick the threads where we left. We want to move toward better relations with India, to resolve the remaining issues through peaceful means, including that of Kashmir," he said.