Nawaz sharif election
© Arshad Arbab/European Pressphoto AgencySupporters of the Pakistan Muslim League-Nawaz danced in Peshawar as its leader, Nawaz Sharif, was elected prime minister.
Nawaz Sharif took office as Pakistan's prime minister for an unparalleled third time on Wednesday, vowing to tackle the country's crippling electricity crisis and issuing an urgent call for the end of American drone strikes on Pakistani soil.

"The chapter of daily drone attacks should stop," a grave-faced Mr. Sharif told the packed lower house of Parliament, where he won a comfortable majority of votes to become prime minister. "We respect the sovereignty of other countries, but others should also respect our sovereignty."

Those comments resonated with many Pakistanis who view the C.I.A. missile strikes as a troubling symbol of American aggression - even if they occasionally kill Pakistan's own enemies, like the country's deputy Taliban leader, Wali ur-Rehman, who died in an attack last week.

But the rate of drone strikes is already declining sharply, amid tough scrutiny of the program in the United States and new restrictions from President Obama. And though the drone issue was a galvanizing one through the campaign season, Mr. Sharif is likely to face even more complex foreign policy challenges now that he is in office.

"Drones are just a side show," said Mosharraf Zaidi, a former Foreign Ministry adviser. "The bigger issue is the American drawdown from Afghanistan in 2014 and what it leaves behind for Pakistan to deal with."

It has been a remarkable comeback for Mr. Sharif, a Punjabi steel tycoon whose last stint as prime minister was abruptly truncated by a military coup in 1999, forcing him into a seven-year exile in Saudi Arabia and London.

Now, after a sweeping victory by his Pakistan Muslim League-Nawaz party in the May 11 election, he returns to power with a strong mandate - one that he will have to employ if he is to tackle the country's daunting array of urgent challenges.

In his speech to Parliament, Mr. Sharif referred to some of those issues: soaring government debt, a sagging economy, lawlessness and corruption. Equally pressing issues that received little mention include the festering Taliban insurgency in the northwest, Baluch separatism in the southwest and strained relations with neighboring India and Afghanistan.

Mr. Sharif said he could not promise to resolve those problems quickly, but he vowed to promote a culture of transparency. "My government will not tolerate any form of corruption," he said as legislators thumped their desks in approval.

His comment on drone strikes suggested a firm, and perhaps more distant, tone in relations with the United States, whose alliance with Pakistan has frequently been stormy in recent years.

During the campaign, Mr. Sharif vowed to limit American influence in the country and drew a firm line against continued drone strikes. He boasted of having resisted American diplomatic and economic pressure in ordering the country's first nuclear tests in 1998.

Analysts caution, however, that Mr. Sharif's approach may have been driven by political considerations, and some suggest that he may be more pragmatic toward the United States now that he is back in office.

In contrast, Mr. Sharif has openly promoted warmer relations with China. In Parliament, he promised to increase economic cooperation with Beijing, including the completion of road and rail links between the Pakistani ports of Gwadar and Karachi, on the Arabian Sea, and the landlocked cities of western China.

Hours after his address, Mr. Sharif was sworn in by his rival, President Asif Ali Zardari, during a brief ceremony at the soaring presidency building that overlooks the capital, Islamabad. Mr. Zardari is to remain in office until September, and though relations between the two men have been tense at times, in recent months there has been little sign of open enmity.

Mr. Sharif's return to power is the first time in Pakistan's fragile democracy that a civilian government has served a full five-year term and peacefully passed power to another administration.

Mr. Sharif's comeback looked distant in December 2000, when the military leader at the time, Gen. Pervez Musharraf, banished him into exile in Saudi Arabia, a year after the coup that ousted him.

Back then, Mr. Sharif had little public support because of accusations of corruption and mismanagement, while the coup received a broad, if short-lived, welcome. During General Musharraf's nine-year tenure, however, Pakistan saw a rise in military violence and political instability.

Mr. Sharif and his opposition rival, Benazir Bhutto, returned from exile in late 2007. Ms. Bhutto was killed in a suicide bombing that year but her party, led by her husband, Mr. Zardari, won the 2008 general elections.

While the Zardari government introduced important constitutional changes and laws that strengthened women's rights, it lost the public's trust amid persistent accusations of mismanagement and corruption, as well as the effects of a painful electricity crisis.

Although Mr. Zardari's Pakistan Peoples Party was trounced in the May 11 election, it remains the country's second-largest political force, just ahead of a grouping led by the former cricketer Imran Khan.

Beyond dealing with Mr. Zardari's party, Mr. Sharif faces a more immediate, and longer standing, test from the military command that toppled him in 1999.

In the years since his return to Pakistan, Mr. Sharif has done little to hide his hostility toward military meddling in democratic politics, and that sense of suspicion was reciprocated by the military top brass. During the negotiations to resolve the 2008 political crisis, the army chief, Gen. Ashfaq Kayani, told the American ambassador then, Anne W. Patterson, that "regardless of how much he disliked Zardari, he distrusted Sharif even more," according to a State Department cable published by WikiLeaks in 2010.

But as elections neared this year, Mr. Sharif toned down his hostility. He says that he will also hold the defense and foreign affairs portfolios himself - a move that some interpret as an effort to coordinate policy on delicate issues, like Afghanistan and Islamist militancy, with the military.

One early litmus test of that relationship may lie in the fate of General Musharraf, who is under house arrest at his villa on the edge of Islamabad facing a litany of charges.