* Sharif likely to form strong government
* Voters deliver blow to PPP, leader of last government
* Former cricket star Imran Khan's party put up strong fight
Toppled in a 1999 military coup, jailed and exiled, Pakistan's Nawaz Sharif has made a triumphant election comeback and looks set to form a stable government capable of implementing reforms needed to rescue the fragile economy.
Sharif may not win enough seats to rule on his own but has built up enough momentum to avoid having to form a coalition with his main rivals, former cricketer Imran Khan's Tehrik-i-Insaf (PTI) and the Pakistan People's Party (PPP).
The steel magnate held off a challenge from Khan, who had hoped to break decades of dominance by Sharif's Pakistan Muslim League (PML-N) and the PPP, led by the Bhutto family. The two parties have formed governments whenever the military, the most powerful force in the nuclear-armed nation, has allowed civilian rule.
Khan put up a strong fight and he is likely to remain a force in politics, possibly becoming the main opposition figure. The PPP, which led the government for the last five years, has done badly and could come in third place.
Television channels said of the results declared by midday on Sunday, Sharif's PML-N had captured 88 of the 272 contested National Assembly seats.
Based on trends, it was likely to get around 130, and should easily be able to make up the required majority of 137 with support from independents and small parties.
The PTI has secured 34 seats while the PPP won 32. The elections, held on Saturday, were marred by a campaign by Islamic fundamentalists to block the voting.
Despite pre-poll violence and attacks on Saturday that killed at least 40 people, voter turnout was a robust 60 percent.
Once it establishes a majority, Sharif's party would be allocated a majority of 70 other parliamentary seats that are reserved for women and non-Muslim minorities.
Sharif has waited patiently to rule Pakistan again. As the main opposition leader, he avoided undermining the PPP when it was in trouble, and analysts describe him as more cautious than when he was prime minister twice in the 1990s.
"Seemingly a genuinely changed man from his troubling stints as prime minister in the 90s, Sharif now appears to have both a genuine mandate as well as a grasp of the direction Pakistan needs to be steered in," said political analyst Cyril Almeida.
In one sense, the polls were a democratic landmark, marking the first time one elected government was to replace another in a country vulnerable to military takeovers.
But Saturday's vote failed to realise the hopes of many that the hold of patronage-based parties would end after years of misrule and corruption.
Sharif, 63, from the prosperous and most populous province of Punjab, declared victory in a jubilant speech to supporters late on Saturday even as votes were still being counted. He is almost certain to become prime minister for a third time.
The religious conservative has said the army, which has ruled the country for more than half of its turbulent 66-year history, should stay out of politics.
But he will have to work with Pakistan's generals, who set foreign and security policy and will manage the country's thorny relationship with the United States as NATO troops withdraw from Afghanistan in 2014.
Sharif also believes Pakistan should reconsider its support for the U.S. war on Islamist militancy, which has earned the country billions of dollars in aid.
Sharif, who advocates free-market economics, is likely to pursue privatisation and deregulation to revive flagging growth. He has said Pakistan should stand on its own two feet but may need to seek a another bailout from the International Monetary Fund to avoid a balance of payments crisis.
The PML-N leader has said he could do business with the IMF, meaning he may be open to reforms like an easing of subsidies and a widening of Pakistan's tiny tax base to secure billions of dollars from the global lender.
But his main job will be to ease widespread discontent over endemic corruption, chronic power cuts and crumbling infrastructure. He has described Pakistan as a "mess" and said the key to moving forward is speedy growth.
Sharif will likely press for negotiation with the Pakistan wing of the Taliban, whose bombing attacks failed to derail the election, but he could run into resistance from the military which has lost thousands of soldiers fighting the insurgency.
Despite Pakistan's history of coups, the army stayed out of politics during the five years of the last government and threw its support behind the election.
However, some fear the military could step back in were there a repeat of the incompetence and corruption that frustrated many Pakistanis during the last government's rule.
In the end, cricketing hero Khan did not have the momentum needed to trip up Sharif despite his popularity among urban youths, many of whom were voting for the first time in an election that saw a robust turnout of around 60 percent.
They had rallied behind Khan's calls for an end to graft and a halt to U.S. drone strikes against suspected militants on Pakistani soil, widely seen as a violation of sovereignty.
Sharif, who was toppled in a 1999 bloodless coup by former army chief Pervez Musharraf, may take steps to improve ties with Pakistan's arch-enemy, India. Efforts to boost trade between the neighbours have stalled due to suspicion on both sides.