Former Pakistani prime minister Nawaz Sharif looked poised to return to office on Sunday 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 has not cracked down on militant groups in its stronghold of Punjab province.
That could be a concern for the US, 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 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 four per cent 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 arch-enemy and neighbour India, which could help the economy.
The Pakistan People's Party (PPP) 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.
Mr 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, based on partial vote counts. That is 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.