Incoming Peruvian President Pedro Pablo Kuczynski attends a Catholic mass at a church outside of Lima, Peru, on June 12. (Mariana Bazo/Reuters)

AT THE turn of the century, Peru was a struggling South American country with a poverty rate of 52 percent, while Venezuela was slightly richer, with 46 percent of the population rated poor. Today the difference between the two countries could hardly be more dramatic. After 17 years of Hugo Chávez’s autocratic populism, poverty in Venezuela has soared to 76 percent, according to a recent survey. Meanwhile, in Peru, it plunged to just 22.7 percent in 2014, and it is still falling.

One big explanation for this difference could be seen in the results of the Peruvian presidential election on June 5, which produced a surprise victory for Pedro Pablo Kuczynski , a right-of-center former investment banker. Repeatedly since the collapse of the right-wing populist regime of Alberto Fujimori in 2000, Peruvians and their leaders have flirted with — and then rejected — populist solutions. The result has been a steady course of centrist, free-market policies and a prolonged boom of foreign investment and exports that have elevated the country of 30 million into the ranks of Latin America’s most successful economies, along with Chile, Mexico and Colombia.

Mr. Kuczynski , who lived in the United States for many years and once held U.S. citizenship, defeated Mr. Fujimori’s daughter, Keiko Fujimori , by a razor-thin margin. He did so largely because many Peruvians feared a revival of the autocracy and corruption that marked the previous Fujimori government and led to Mr. Fujimori’s imprisonment. In the end even Peru’s left-wing leader endorsed the 77-year-old Mr. Kuczynski , who promised democratic stability and seasoned, technocratic management of the economy.

Such skill will be needed. Like much of Latin America, Peru has been buffeted by plunging commodity prices and a drop-off of China’s appetite for raw materials — though it has avoided the steep recession, exacerbated by mismanagement, that afflicts Venezuela and Brazil. Mr. Kuczynski is promising some pump-priming measures, including an increase in the minimum wage and cuts in consumption taxes, to be balanced by drawing more of Peru’s large informal economy into the taxation system. A predictable, business-friendly government could also attract more of the big mining investments that have propelled the steady reduction of poverty.

Mr. Kuczynski will replace Ollanta Humala, who began his political career as a would-be leftist imitator of Mr. Chávez but who ended up sustaining the centrist policies of his post-Fujimori predecessors. Peru thus becomes the third South American country, after Argentina and Brazil, to shift toward the right in recent months. The resurgence of what Latin Americans call “neo-liberalism,” and the embrace of uncharismatic characters such as Mr. Kuczynski , is a reaction to the abject failure of Mr. Chávez and his followers, whose demagoguery, persecution of opponents and gross disregard of economic fundamentals inevitably led to catastrophe.

Eighteen years after Mr. Chávez first rose to power, much of Latin America seemingly has been inoculated against populist authoritarianism. If only the rest of the West were so lucky.