Former Pakistani Prime Minister Nawaz Sharif appeared set to return to office 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 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 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 Sharif’s favor would give his Pakistan Muslim League-N party a ruling majority.

That would put Sharif, 63, 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.

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 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.

It was a remarkable comeback for the two-time prime minister, who was toppled in a 1999 coup by then-army chief Gen. 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.

President Barack Obama praised “the historic peaceful and transparent transfer of civilian power.”

In an ironic twist, the man who toppled Sharif in a military coup, Musharraf, is under house arrest in the country after returning from self-imposed exile. It will be up to Sharif’s government to decide whether to bring treason charges against Musharraf in the Supreme Court.

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 election day.

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 Sharif and Khan, because they were able to campaign more freely.

Sharif has called for negotiations with the Pakistani Taliban but hasn’t said clearly whether he thinks army operations against the militants should continue until peace is achieved.