Former Pakistani Prime Minister Nawaz Sharif was posed Sunday to return to power for a third term, a remarkable political comeback after being deposed in a 1999 military coup, jailed and exiled to Saudi Arabia.
The 63-year-old conservative and steel magnate held off a challenge from his main rivals, former cricketer Imran Khan and the Pakistan People's Party, led by the Bhutto family.
Sharif served as prime minister twice during the nineties and oversaw Pakistan's first nuclear weapons test, but was ousted by former army chief, General Pervez Musharraf.
While he has said the military - which has ruled Pakistan for more than half of its turbulent history - should stay out of politics, Sharif will have to work with the country's generals, who set foreign and security policy.
In 2007, Sharif returned to Pakistan from Saudi Arabia but was barred from contesting elections due to a prior criminal conviction for terrorism and hijacking stemming from the Musharraf coup.
The Supreme Court overturned his conviction in 2009.
Sharif's main tasks will be to tackle Pakistan's stalled economy, serious infrastructure failures and grave threats from an emboldened Taliban insurgency.
The nationalist leader of the Pakistan Muslim League (PML-N) has hinted he is open to negotiating with Taliban militants who are active in wide areas of the country's volatile northwest. His stance could see resistance from Pakistan's military, which has lost thousands of soldiers fighting the Islamist insurgency.
In relations with the United States, Sharif is expected to assert Pakistani sovereignty more vigorously than the outgoing government. He has criticized the Afghan conflict as "America's war."
Analysts also say Sharif will likely continue his past efforts to improve ties with Pakistan's arch rival, neighboring India.
Some information for this report was provided by AP, AFP and Reuters.