ALSO READGen Sharif an important US partner against terrorism: McCain HRCP asks PM Sharif to reassess 'counter-terrorism strategy' Pak SC questions money trail of PM Sharif's London flats Sharif's daughter owned London flats for 6 months: Pak SC told Pak successfully tackling terror, economic challenges: Sharif
Nawaz Sharif, the only Pakistani politician who has the distinction of being the prime minister of the coup-prone country for a record three times, today managed to avert the ignominy of being forced out for a third time without completing his term.
Sharif, who was forced to quit twice in the middle of his term - first by the presidency, then the military - survived a similar fate at the hands of judiciary.
Sharif, who leads the country's most powerful political family and the ruling PML-N party, successfully managed to swim through all the "tsunamis" since he assumed power for the third term in June 2013.
The PML-N leader, seen by many as someone who can fix the country's problems such as economy and the terrorism, had found himself besieged by problems after Panama papers showed illegal money laundering by him in 1990s when he twice served as Prime Minister to purchase assets in London.
The revelation forced Sharif to address the nation twice and disclose a detailed account of his family's businesses in the National Assembly, explaining how his late father had built the business empire, which was the source of income used to buy properties in London and other holdings.
Sharif, popular among his followers as the 'Lion of Punjab', had promised to quit if found guilty in the case.
The ruling by a five-member bench today to set up a Joint Investigation Team to probe the graft allegations against Sharif's family provided him a big relief at a time when country is facing brittle economy and surge in militancy.
A steel tycoon cum politician, Sharif had served as the Prime Minister for the first time from 1990 to 1993.
During his tenure, Sharif developed serious differences with conservative president Ghulam Ishaq Khan, who dissolved the National Assembly using his reserve powers in April 1993. In July, Sharif resigned under pressure from the army but made a settlement that resulted in the removal of Khan as well.
Sharif's second term as Prime Minister from 1997 ended in October 1999 when then powerful Army Chief General Pervez Musharraf carried out a bloodless coup.
In a dramatic fall from grace, Sharif ended up in jail, convicted of hijacking charges for trying to stop a plane carrying Musharraf from landing. He then went into exile in Saudi Arabia and didn't return to Pakistan until 2007, when he teamed up with the PPP to force Musharraf from office.
Both of Sharif's first two stints had ended in the third year of his tenure.
In the 2013 elections, Sharif's centre-right Pakistan Muslim League-N (PML-N) emerged as the single largest party falling just short of a majority. But, he was able to muster the required strength within days as many independents came forward to support him.
During his third term, Sharif has managed to swim through several crisis such as massive protest rallies outside the parliament in his second year in office by cricketer-turned- politician Imran Khan's Pakistan Tehreek-e-Insaf party and supporters of influential cleric Tahirul Qadri.
During this tenure, Sharif launched a number of development projects including the multi-billion China- Pakistan Economic Corridor (CPEC).
His another major achievement has been the launch of military operation Zarb-e-Azb in 2014 to flush out the militants from North Waziristan and South Waziristan.
Sharif, who was considered to be soft on hardliners, backed a ban on Tablighi Jamaat from preaching in educational institutions. In a stern message to extremists, his government hanged Mumtaz Qadri who shot dead Punjab Governor Salman Taseer in 2011 over his opposition to blasphemy laws.
In the beginning of his term in 2013, the PML-N leader had promised to improve relations with India and he developed good chemistry with Prime Minister Narendra Modi, who made a surprise visit to Lahore to meet Sharif.
However, terror attacks on Indian defence installations last year by Pakistan-based terrorists derailed the Indo-Pak relations.
Under the Sharif regime, Pakistan has been at loggerheads with India over several issues, including on Islamabad's support to terrorism.
Sharif was born in 1949 into a wealthy family of industrialists in Lahore and was educated privately at English-language schools.
He received a degree in law from the University of Punjab before joining his father's steel company and eventually entering politics.
Under the patronage of former military ruler Zia-ul Haq, Sharif became first finance minister and then chief minister of Punjab - a post he held for five years from 1985 until he was elected prime minister in 1990.