Pakistanis deserve credit for their courage, and the military for allowing the election to go ahead and deploying 73,000 troops to keep order. And while serious charges of vote-riggingmust be investigated, it appears that most Pakistanis are willing to accept partial returns suggesting that former Prime Minister Nawaz Sharif and his party will dominate the next Parliament.

Mr. Sharif faces staggering challenges. With the economy in a death spiral, he wisely made his finance minister his first appointment, selecting Ishaq Dar. Mr. Dar held that job twice in the 1990s. Mr. Sharif is a fiscal conservative who favors free-market economics. His tasks are to reduce a bloated public sector, end energy shortages and persuade Pakistanis to pay taxes, without which the government cannot hope to stabilize the economy.

Making peace and fostering trade with India would advance that goal. Mr. Sharif’s decision to invite Prime Minister Manmohan Singh of India to his inauguration was an inspired beginning. But a major obstacle to effective civilian rule in Pakistan and peace with India, has been the military, which ousted Mr. Sharif in 1999. Mr. Sharif returned from exile in 2007 to build a new political movement. The Army has since withdrawn from an overt political role, yet it remains a potent force.

Repairing badly damaged relations with the United States will be another major test. Mr. Sharif has major differences with the American government, including his tendency to coddle terrorist groups and his opposition to drone strikes, but he has worked with the United States in the past and should try again. President Obama should invite Mr. Sharif to make an early visit to the White House.

Ultimately, the success of democracies and the politicians they produce depend on good governance. It is up to Mr. Sharif to prove that strong civilian leadership can turn things around in Pakistan.

Read online at