Lahore: Former Pakistani Prime Minister Nawaz Sharif looked poised to return to office with a resounding election victory - a mandate that could make it easier to tackle the country's daunting problems, including growing power outages, weak economic growth and shaky government finances.
Questions remain, however, about Mr Sharif's stance on another key issue: violent Islamic extremism. Critics have accused his party of being soft on radicals because it hasn't cracked down on militant groups in its stronghold of Punjab province.
That could be a concern for the United States, which has pushed Pakistan for years to take stronger action against a variety of Islamic militant groups, especially fighters staging cross-border attacks against American troops in Afghanistan.
As unofficial returns rolled in Sunday, a day after the election, state TV estimates put Mr Sharif close to the majority in the national assembly needed to govern outright for the next five years. Even if he falls short of that threshold, independent candidates almost certain to swing in Mr Sharif's favour would give his Pakistan Muslim League-N party a ruling majority.
That would put the 63-year-old Mr Sharif in a much stronger position than the outgoing Pakistan People's Party, which ruled for five years with a weak coalition that was often on the verge of collapse.
Pakistan suffers from a growing energy crisis, with some areas experiencing power outages for up to 18 hours a day. That has seriously hurt the economy, pushing growth below 4 percent a year. The country needs a growth rate of twice that to provide jobs for its expanding population of 180 million.
Ballooning energy subsidies and payments to keep failing public enterprises afloat have steadily eaten away at the government's finances, forcing the country to seek another unpopular bailout from the International Monetary Fund. Pakistan also has an ineffective tax system, depriving the government of funds.
Mr Sharif, the son of a wealthy industrialist, is seen by many as more likely to tackle the country's economic problems effectively because much of his party's support comes from businessmen. He is also expected to push for better relations with Pakistan's archenemy and neighbor India, which could help the economy.
The Pakistan People's Party was widely perceived to have done little on the economic front.
"Anything better than zero and you have already improved on the PPP's performance in terms of managing the economy," said Cyril Almeida, a columnist for Pakistan's Dawn newspaper.
The former ruling party was soundly beaten in Saturday's election. Sharif's party was leading in contests for 127 seats, just short of the 137 directly elected seats needed to form a majority, state TV said.
The PPP was ahead in contests for 32 national assembly seats, a significant drop from the 91 seats the party won in the 2008 election.
Independent candidates were leading in more than 20 contests, and they historically join the party that forms the government, which would leave the Pakistan Muslim League-N with a majority.
"I'm sure business and the economy will be far better in a couple of years," said Amir Nayaz, one of hundreds of Sharif supporters who gathered outside his home in Punjab's capital, Lahore, beating on drums, dancing and chanting slogans.
It was a remarkable comeback for the two-time prime minister, who was toppled in a 1999 coup by then-army chief General Pervez Musharraf and was sent into exile in Saudi Arabia for years. He returned in 2007, and his party came in second in elections the following year.
Over the last five years, Mr Sharif put steady pressure on the PPP-led government. But because he was wary of army interference, he never applied enough pressure to threaten the government's hold on power. That attitude helped enable parliament to complete its term and transfer power in democratic elections for the first time since the country was founded in 1947.
In an ironic twist, the man who toppled Mr Sharif in a military coup, General Musharraf, is currently under house arrest in the country after returning from self-imposed exile. It will be up to Mr Sharif's government to decide whether to bring treason charges against General Musharraf in the Supreme Court.
Mr Sharif's party managed to weather a serious challenge from former cricket star Imran Khan, whose criticism of the country's traditional politicians energized the youth. Even though Imran Khan failed to deliver his promised "political tsunami," his Pakistan Tehreek-e-Insaf party did much better than it had historically.
It was leading in contests for 31 national assembly seats, state TV said, and appeared to be in position to possibly form the government in northwest Khyber Pakhtunkhwa province. The party boycotted elections in 2008 and only won one national assembly seat in 2002.
The Pakistani Taliban, which has been waging a bloody insurgency against the government, tried to derail the election with attacks. More than 150 people were killed with guns and bombs in the run-up to the election, including 29 on the day of election.
The deadly campaign failed to keep people away from the polls. Turnout was nearly 60 percent, the highest in more than 40 years, the election commission said. But the violence, which mainly targeted secular parties, may have helped candidates seen as taking a softer line toward the militants, like Mr Sharif and Mr Khan, because they were able to campaign more freely.