Peruvian economist Hernando de Soto on how terrorism can be defeated by economic and legal reform in poor countries.

As the U.S. moves into a new theater of the war on terror, it will miss its best chance to beat back Islamic State and other radical groups in the Middle East if it doesn’t deploy a crucial but little-used weapon: an aggressive agenda for economic empowerment. Right now, all we hear about are airstrikes and military maneuvers—which is to be expected when facing down thugs bent on mayhem and destruction.

But if the goal is not only to degrade what President Barack Obama rightly calls Islamic State’s “network of death” but to make it impossible for radical leaders to recruit terrorists in the first place, the West must learn a simple lesson: Economic hope is the only way to win the battle for the constituencies on which terrorist groups feed.

I know something about this. A generation ago, much of Latin America was in turmoil. By 1990, a Marxist-Leninist terrorist organization called Sendero Luminoso, or Shining Path, had seized control of most of my home country, Peru, where I served as the president’s principal adviser. Fashionable opinion held that the people rebelling were the impoverished or underemployed wage slaves of Latin America, that capitalism couldn’t work outside the West and that Latin cultures didn’t really understand market economics.

The conventional wisdom proved to be wrong, however. Reforms in Peru gave indigenous entrepreneurs and farmers control over their assets and a new, more accessible legal framework in which to run businesses, make contracts and borrow—spurring an unprecedented rise in living standards.

Between 1980 and 1993, Peru won the only victory against a terrorist movement since the fall of communism without the intervention of foreign troops or significant outside financial support for its military. Over the next two decades, Peru’s gross national product per capita grew twice as fast as the average in the rest of Latin America, with its middle class growing four times faster.

Today we hear the same economic and cultural pessimism about the Arab world that we did about Peru in the 1980s. But we know better. Just as Shining Path was beaten in Peru, so can terrorists be defeated by reforms that create an unstoppable constituency for rising living standards in the Middle East and North Africa.

To make this agenda a reality, the only requirements are a little imagination, a hefty dose of capital (injected from the bottom up) and government leadership to build, streamline and fortify the laws and structures that let capitalism flourish. As anyone who’s walked the streets of Lima, Tunis and Cairo knows, capital isn’t the problem—it is the solution.

Here’s the Peru story in brief: Shining Path, led by a former professor named Abimael Guzmán, attempted to overthrow the Peruvian government in the 1980s. The group initially appealed to some desperately poor farmers in the countryside, who shared their profound distrust of Peru’s elites. Mr. Guzmán cast himself as the savior of proletarians who had languished for too long under Peru’s abusive capitalists.

What changed the debate, and ultimately the government’s response, was proof that the poor in Peru weren’t unemployed or underemployed laborers or farmers, as the conventional wisdom held at the time. Instead, most of them were small entrepreneurs, operating off the books
in Peru’s “informal” economy. They accounted for 62% of Peru’s population and generated 34% of its gross domestic product—and they had accumulated some $70 billion worth of real-estate assets.

This new way of seeing economic reality led to major constitutional and legal reforms. Peru reduced by 75% the red tape blocking access to economic activity, provided ombudsmen and mechanisms for filing complaints against government agencies and recognized the property rights of the majority. One legislative package alone gave official recognition to 380,000 informal businesses, thus bringing above board, from 1990 to 1994, some 500,000 jobs and $8 billion in tax revenue.

These steps left Peru’s terrorists without a solid constituency in the cities. In the countryside, however, they were relentless: By 1990, they had killed 30,000 farmers who had resisted being herded into mass communes. According to a Rand Corp. report, Shining Path controlled 60% of Peru and was poised to take over the country within two years.

Peru’s army knew that the farmers could help them to identify and defeat the enemy. But the government resisted making an alliance with the informal defense organizations that the farmers set up to fight back. We got a lucky break in 1991 when then-U.S. Vice President Dan Quayle, who had been following our efforts, arranged a meeting with President George H.W. Bush at the White House. “What you’re telling me,” the president said, “is that these little guys are really on our side.” He got it.

This led to a treaty with the U.S. that encouraged Peru to mount a popular armed defense against Shining Path while also committing the U.S. to support economic reform as an alternative to the terrorist group’s agenda. Peru rapidly fielded a much larger, mixed-class volunteer army—four times the army’s previous size—and won the war in short order. As Mr. Guzmán wrote at the time in a document published by Peru’s Communist Party, “We have been displaced by a plan designed and implemented by de Soto and Yankee imperialism.”

Looking back, what was crucial to this effort was our success in persuading U.S. leaders and policy makers, as well as key figures at the United Nations, to see Peru’s countryside differently: as a breeding ground not for Marxist revolution but for a new, modern capitalist economy. These new habits of mind helped us to beat back terror in Peru and can do the same, I believe, in the Middle East and North Africa. The stakes couldn’t be higher. The Arab world’s informal economy includes vast numbers of potential Islamic State recruits—and where they go, so goes the region.

It is widely known that the Arab Spring was sparked by the self-immolation in 2011 of Mohamed Bouazizi, a 26-year-old Tunisian street merchant. But few have asked why Bouazizi felt driven to kill himself—or why, within 60 days, at least 63 more men and women in Tunisia, Algeria, Morocco, Yemen, Saudi Arabia and Egypt also set themselves on fire, sending millions into the streets, toppling four regimes and leading us to today’s turmoil in the Arab world.

To understand why, my institute joined with Utica, Tunisia’s largest business organization, to put together a research team of some 30 Arabs and Peruvians, who fanned out across the region. Over the course of two years, we interviewed the victims’ families and associates, as well as a dozen other self-immolators who had survived their burns.

These suicides, we found, weren’t pleas for political or religious rights or for higher wage subsidies, as some have argued. Bouazizi and the others who burned themselves were extralegal entrepreneurs: builders, contractors, caterers, small vendors and the like. In their dying statements, none referred to religion or politics. Most of those who survived their burns and agreed to be interviewed spoke to us of “economic exclusion.” Their great objective was “ras el mel” (Arabic for “capital”), and their despair and indignation sprang from the arbitrary expropriation of what little capital they had.

Bouazizi’s plight as a small entrepreneur could stand in for the frustrations that millions of Arabs still face. The Tunisian wasn’t a simple laborer. He was a trader from age 12. By the time he was 19, he was keeping the books at the local market. At 26, he was selling fruits and vegetables from different carts and sites.

His mother told us that he was on his way to forming a company of his own and dreamed of buying a pickup truck to take produce to other retail outlets to expand his business. But to get a loan to buy the truck, he needed collateral—and since the assets he held weren’t legally recorded or had murky titles, he didn’t qualify.

Meanwhile, government inspectors made Bouazizi’s life miserable, shaking him down for bribes when he couldn’t produce licenses that were (by design) virtually unobtainable. He tired of the abuse. The day he killed himself, inspectors had come to seize his merchandise and his electronic scale for weighing goods. A tussle began. One municipal inspector, a woman, slapped Bouazizi across the face. That humiliation, along with the confiscation of just $225 worth of his wares, is said to have led the young man to take his own life.

Tunisia’s system of cronyism, which demanded payoffs for official protection at every turn, had withdrawn its support from Bouazizi and ruined him. He could no longer generate profits or repay the loans he had taken to buy the confiscated merchandise. He was bankrupt, and the truck that he dreamed of purchasing was now also out of reach. He couldn’t sell and relocate because he had no legal title to his business to pass on. So he died in flames—wearing Western-style sneakers, jeans, a T-shirt and a zippered jacket, demanding the right to work in a legal market economy.

I asked Bouazizi’s brother Salem if he thought that his late sibling had left a legacy. “Of course,” he said. “He believed the poor had the right to buy and sell.” As Mehdi Belli, a university information-technology graduate working as a merchant at a market in Tunis, told us, “We are all Mohamed Bouazizi.”

The people of the “Arab street” want to find a place in the modern capitalist economy. But hundreds of millions of them have been unable to do so because of legal constraints to which both local leaders and Western elites are often blind. They have ended up as economic refugees in their own countries.

To survive, they have cobbled together hundreds of discrete, anarchic arrangements, often called the “informal economy.” Unfortunately, that sector is viewed with contempt by many Arabs and by Western development experts, who prefer well-intended charity projects like providing mosquito nets and nutritional supplements.

But policy makers are missing the real stakes: If ordinary people in the Middle East and North Africa cannot play the game legally—despite their heroic sacrifices—they will be far less able to resist a terrorist offensive, and the most desperate among them may even be recruited to the jihadist cause.

Western experts may fail to see these economic realities, but they are increasingly understood in the Arab world itself, as I’ve learned from spending time there. At conferences throughout the region over the past year, I have presented our findings to business leaders, public officials and the press, showing how the millions of small, extralegal entrepreneurs like Bouazizi can change national economies.

For example, when the new president of Egypt, Abdel Fattah Al Sisi, asked us to update our numbers for his country, we discovered that the poor in Egypt get as much income from returns on capital as they do from salaries. In 2013, Egypt had about 24 million salaried citizens categorized as “workers.” They earned a total of some $21 billion a year but also owned about $360 billion of “dead” capital—that is, capital that couldn’t be used effectively because it exists in the shadows, beyond legal recognition.

For perspective: That amounts to roughly a hundred times more than what the West is going to give to Egypt this year in financial, military and development assistance—and eight times more than the value of all foreign direct investment in Egypt since Napoleon invaded more than 200 years ago.

Of course, Arab states even now have laws allowing assets to be leveraged or converted into capital that can be invested and saved. But the procedures for doing so are impenetrably cumbersome, especially for those who lack education and connections. For the poor in many Arab states, it can take years to do something as simple as validating a title to real estate.

At a recent conference in Tunisia, I told leaders, “You don’t have the legal infrastructure for poor people to come into the system.”

“You don’t need to tell us this,” said one businessman. “We’ve always been for entrepreneurs. Your prophet chased the merchants from the temple. Our prophet was a merchant!”

Many Arab business groups are keen for a new era of legal reform. In his much-discussed 2009 speech in Cairo, President Obama spoke of the deep American commitment to “the rule of law and the equal administration of justice.” But the U.S. has yet to get behind the agenda of legal and constitutional reform in the Arab world, and if the U.S. hesitates, lesser powers will too.

Washington should support Arab leaders who not only resist the extremism of the jihadists but also heed the call of Bouazizi and all the others who gave their lives to protest the theft of their capital. Bouazizi and those like him aren’t marginal people in the region’s drama. They are the central actors.

All too often, the way that Westerners think about the world’s poor closes their eyes to reality on the ground. In the Middle East and North Africa, it turns out, legions of aspiring entrepreneurs are doing everything they can, against long odds, to claw their way into the middle class. And that is true across all of the world’s regions, peoples and faiths. Economic aspirations trump the overhyped “cultural gaps” so often invoked to rationalize inaction.

As countries from China to Peru to Botswana have proved in recent years, poor people can adapt quickly when given a framework of modern rules for property and capital. The trick is to start. We must remember that, throughout history, capitalism has been created by those who were once poor.

I can tell you firsthand that terrorist leaders are very different from their recruits. The radical leaders whom I encountered in Peru were generally murderous, coldblooded, tactical planners with unwavering ambitions to seize control of the government. Most of their sympathizers and would-be recruits, by contrast, would rather have been legal economic agents, creating better lives for themselves and their families.

The best way to end terrorist violence is to make sure that the twisted calls of terrorist leaders fall on deaf ears.