Nawaz Sharif, a two-time former prime minister who has talked about ending Pakistan's role in the U.S.-led war against terrorism, was set to win a third term as the South Asian nation's leader on Sunday.
An unofficial tally put Mr. Sharif's Pakistan Muslim League (Nawaz) party ahead of its nearest rival by more than 100 seats and close to the majority required to govern without the help of coalition partners.
Mr. Sharif was in talks on Sunday night to form a government.
President Asif Ali Zardari's ruling Pakistan People's Party (PPP) suffered a humiliating defeat, placing a distant third behind the Pakistan Tehreek-i-Insaf party (PTI), led by cricketer-turned-politician Imran Khan.
The election marks the first time in Pakistan's 65-year history that a civilian administration will hand over power to another democratically elected government.
President Obama hailed the event as "a significant milestone in Pakistan's democratic progress."
"The United States and Pakistan have a long history of working together on mutual interests, and my administration looks forward to continuing our cooperation with the Pakistani government that emerges from this election as equal partners in supporting a more stable, secure and prosperous future for the people of Pakistan," Mr. Obama said.
Most analysts, however, expect little improvement in the U.S.-Pakistan relationship, which has been strained by the Obama administration's policy of drone strikes against suspected terrorists in Pakistan's tribal border region.
"Sharif's election won't change the bad blood that haunts U.S.-Pakistan relations," said Bruce Riedel, a former CIA officer who heads the Intelligence Project at the Brookings Institution. Mr. Riedel worked closely with Mr. Sharif while serving as a senior adviser to presidents George H.W. Bush and Bill Clinton.
In his campaign speeches, Mr. Sharif vowed to end Pakistan's role in the U.S. war on al Qaeda and its affiliates.
However, Ayesha Siddiqa, an Islamabad-based political analyst, believes Mr. Sharif's rhetoric was a response to the hard anti-U.S. line taken by Mr. Khan of the PTI.
"There are things which are done for publicity because PTI had raised the bar in terms of rhetoric vis-a-vis the U.S.," said Ms. Siddiqa. "Nawaz Sharif had to partly match it. That doesn't mean that he is not capable of pragmatic politics."
Mr. Khan, whose party won around 35 seats according to an unofficial tally, accused Mr. Sharif's party of vote-rigging.
Kamran Shafi, an Islamabad-based columnist with Pakistan's Express Tribune, said he was surprised by the PPP's dismal performance in southern Punjab province and the PTI's big win in the tribal border province of Khyber Pakhtunkhwa.
"The latter is built around Imran's rhetoric of stopping drone attacks, which is not about to happen, and the former because of the incumbency factor and the fact that the PPP couldn't really canvass because of security threats," said Mr. Shafi.
The election campaign was marred by Taliban threats. Election-day violence on Saturday claimed at least two dozen lives in the port city of Karachi, in the northwest and in the southwestern province of Baluchistan.
Pakistani voters were undeterred. The election commission reported an unusually high 60 percent voter turnout.
Mr. Obama said the Pakistani people had, by "persevering despite intimidation by violent extremists ... affirmed a commitment to democratic rule that will be critical to achieving peace and prosperity for all Pakistanis for years to come."
The new government will be faced with big challenges, including an energy crisis, runaway inflation and the growing Taliban insurgency.
Afghan President Hamid Karzai said he hopes a new government in Islamabad "cooperates in fighting terrorism and sincerely rooting out terrorist sanctuaries."
Indian Prime Minister Manmohan Singh invited Mr. Sharif to visit Pakistan's South Asian rival.
India and Pakistan came to the brink of an all-out war when Mr. Sharif was prime minister in 1999. President Bill Clinton had to personally intervene to cool tensions between the nuclear-armed neighbors.
"The U.S. has worked productively with [Mr. Sharif]," said Mr. Riedel, who was present at a tense Blair House meeting in Washington between Mr. Clinton and Mr. Sharif on July 4, 1999, to defuse tensions with India.
Three months later, Mr. Sharif was ousted in a coup by his army chief, Pervez Musharraf, and sent into exile in Saudi Arabia.
"On foreign policy, the big winner is Saudi Arabia and [Saudi] King Abdullah," said Mr. Riedel. "[Saudi Arabia's] voice will be heard in Islamabad more than ever."
Mr. Sharif's relationship with the army, which closely controls Pakistan's relationship with the United States, will be significant.
"The central challenge for Nawaz is to control the army and ISI," said Mr. Riedel, referring to Pakistan's Inter-Services Intelligence agency. "He must help pick an [army chief] that will work with the civilians."
Pakistan's Army Chief, Gen. Ashfaq Parvez Kayani, is slated to leave office in November.
"When you talk about U.S.-Pakistan relationship, these are issues that ultimately come within the purview of the military," said Michael Kugelman, senior South Asia associate at the Wilson Center.
"Certainly I think a Prime Minister Sharif may push back more on Washington a bit more so than the PPP government has on issues like drone strikes and issues pertinent to the Afghanistan endgame, but ultimately this is the military's house and the military will be making the decisions."
© Copyright 2016 The Washington Times, LLC. Click here for reprint permission.