PAKISTAN’S ELECTION Saturday is being celebrated as paving the way for the first transfer of power from one elected government to another in the country’s history. Forty million new voters are registered, and a third of all those on the rolls are under the age of 30. The balloting appears likely to produce a stronger set of civilian leaders who are more able to tackle the country’s deep economic problems and curb the overweening power of the military.

For all that, there’s not much reason for optimism that the multiple problems that bedevil U.S.-Pakistani relations will get any easier. In fact, some may get worse. The two apparent front-runners in the voting for the national parliament, the Muslim League of former prime minister Nawaz Sharif and the Movement for Justice party of former cricket star Imran Khan, are both softer on the Pakistani Taliban and tougher on the United States than is either the military or the current civilian government. Mr. Sharif has promised to negotiate with the jihadists, while Mr. Khan says he will end “America’s war” against them and shoot down U.S. drones.

The Taliban itself condemns the elections but has played an ominous role in them. While sparing the parties of Mr. Khan and Mr. Sharif, it has conducted a wave of bombings and assassinations directed at secular parties; more than 100 people have been killed. The chairman of the ruling Pakistan People’s Party, Bilawal Bhutto Zardari, has been limited to making appearances by video; according to some accounts, he is based in Dubai. The son of Yousuf Raza Gilani, the party’s former prime minister, was kidnapped Thursday.

The Obama administration will have to hope that the conventional wisdom predicting that Mr. Sharif will become prime minister will prove correct and that the 63-year-old political war horse will deliver on his promises to revive the economy. He has pledged to tackle the severe power shortages that are crippling Pakistani industry and build new infrastructure, including even a bullet train across the country.

During his previous term as prime minister, which was ended by a 1999 military coup, Mr. Sharif had a relatively cooperative relationship with the Clinton administration even though he presided over the country’s first nuclear test. If his priorities are really economic, he’ll have an incentive to keep U.S. aid flowing: $1 billion annually has been promised, though some has been withheld in recent years.

Mr. Sharif may also try to assert himself over the military, which has controlled Pakistani policy toward both the Taliban and Afghanistan under the present, elected government. Army Chief of Staff Ashfaq Kayani, who has taken a tougher line than Mr. Sharif against the Pakistani Taliban, is due to retire this year. But it’s unlikely a civilian leader will be able to change Pakistan’s troublesome behavior in Afghanistan, which has involved quiet cooperation with some Taliban leaders and the disruption of U.S. and Afghan government attempts to negotiate a peace.

A more democratic Pakistan is in the United States’ interest in the long run. In the near term, more trouble is likely.