WASHINGTON—The recent Peruvian elections produced the results that many had feared. At a time of unprecedented political stability and economic boom in Peru, the voters have opted for two candidates with authoritarian credentials who will face each other in a runoff.

The first, and the big winner with more than 31 percent of the vote, is Ollanta Humala, a nationalist former lieutenant colonel who until recently had a close relationship with Venezuela, but now says he admires the “Lula” model—after former Brazilian President Luiz Inacio Lula da Silva, who combined the market economy with huge social programs and left office when his second term ended. The other top-two finisher, with 23 percent of the vote, was Keiko Fujimori, daughter and close collaborator of former dictator Alberto Fujimori, who is in prison for corruption and crimes against humanity.

Almost half the country voted for candidates who represent the market democracy under which the country has boomed. But these candidates split the vote of millions of Peruvians who wanted to maintain and expand the current model, and therefore neutralized each other.

One cannot blithely dismiss the fact that the other half of Peruvians—the ones who will be represented in the runoff—have very little enthusiasm for liberal democracy and believe the market economy is skewed against them. Latinobarometro, a respected organization that conducts in-depth surveys throughout the continent, revealed a few days ago that 52 percent of Peruvians favor a dictatorial regime. The result roughly matches the vote that went to Humala and Fujimori combined.

The reasons why so many people are angry are not difficult to figure out: the big pockets of poverty, where the benefits of the boom have not had great impact; the contradiction between an economy that has seen the reduction of poverty to one-third of the population but where one in three citizens still does not have direct access to drinkable water and the judicial system is perceived as profoundly corrupt; and the insecurity that prevails in a country where one in three people has been a victim of some kind of crime.

Even so, the progress made in the last decade goes far beyond a tiny elite. In political terms, we are talking about the difference between night and day. Freedom of expression, freedom of association, the right of habeas corpus, free and fair elections and the prosecution of human rights violators attest to it. Economically, the achievement is also notable: In the last five years alone, Peru has jumped 24 positions in the U.N.’s Index of Human Development. The question in this election, then, was not how do Peruvians replace the system with authoritarian populism but how do they correct its significant shortcomings and expand opportunity without compromising what is good. The division of the more reasonable camp into three mutually defeating candidacies ensured that the second round will become not a dialogue between the two big trends in Peruvian society but a pitched battle between two forces that resent modernity either in its political or its economic aspects.

Although Fujimori will have the support of the Peruvian establishment out of fear that Humala could become another Hugo Chavez, the former soldier is more likely to prevail. He commands more votes at this point, has a greater national presence and, with the help of Brazilian advisers, has created an image of himself that is more moderate than it was five years ago, when he also sought office.

If Humala goes on to win, will he become another Chavez or will he follow the Lula model, as he promises? The answer will depend not on strong institutions capable of reining in the excesses of a Chavez emulator but on Humala and him only. If he decides to go ahead with plans to change the constitution and, in the face of resistance from the current Congress, calls elections to a new constituent assembly, the opposition will simply be swept away. And then the sky, as they say, will be the limit.

Still, there is a chance, if Humala wins, that he will be content with preserving the democratic system, avoiding nationalizations and engaging in populism with the colossal amount of reserves Peru has accumulated in recent years. Such a populist outcome would probably hurt growth at some point and slow the progress that the country is now making but would not bring about an ideological dictatorship.

That, in Peru’s current situation and given the alternative, would almost be a blessing.