The dramatic initial success of Operation Enduring Freedom in Afghanistan, by any measure one of history’s most effective military offensives, gave way to 20 years of increasingly bureaucratic, decreasingly effective nation-building efforts, culminating in this month’s surrender to the Taliban and calamitous evacuation of Kabul.

As the Biden administration planned what would become the August Afghan debacle, its National Security Council was also putting together nation-building blueprints for another part of the world. On Feb. 2, President Biden signed an Executive Order calling for the development of a comprehensive approach to the burgeoning immigration (non)crisis. Six months and a staggering 991,000 Customs and Border Protection encounters later, the White House has rolled out its “Strategy for Addressing the Root Causes of Migration.”

An America that fails to learn from its mistakes in Afghanistan is bound to repeat those mistakes in Central America.

The first and most important lesson of Afghanistan is that the U.S. cannot self-isolate, retreat from difficult geopolitical environments, and hope that our enemies will do the same. The initial Afghanistan operation in 2001 proved a resounding success in that, in response to 9/11, it disabled al Qaeda, unseated the Taliban and helped to prevent a second attack on U.S. soil. That initial offensive evolved into a massive, complex, arguably necessary reconstruction effort that should have been periodically re-assessed and re-calibrated, but not abandoned. Instead, the U.S. surrenders Afghanistan to a more dangerous Taliban than before and emboldened jihadists waiting for the opportunity to move in, regroup, and plan their next terrorist offensives against a weakened America.

The Biden administration has been rightfully criticized for its failure to mitigate, or even recognize, the ongoing border crisis. The spotlight it has directed toward Central America and the “root cause” issues, by contrast, is long overdue. Latin American nations riddled with government corruption, transnational criminal organizations operating with impunity, and economic underdevelopment are not only migratory source countries, but they also areas of strategic opportunity for global enemies.

El Salvador, inexplicably ignored diplomatically by the Biden administration, becomes more politically intertwined with the Chinese Communist Party by the day. China also has found a willing ally in Mexico, where it readily moves fentanyl and pseudoephedrine, a methamphetamine precursor, into the hands of Mexican criminal organizations. Honduras, thus far, has repelled the advances of the Chinese but faces a presidential election this November with a socialist candidate leading in early polling.

America has vital national security interests in the viability of democratic Latin American nations that go far beyond immigration. If Islamic terrorist organizations regroup and strengthen under Taliban protection, as expected, the migratory chaos on the southern U.S. border provides an easy opportunity for undetected jihadist entry into the U.S. In terms of nation-state enemies, the prospect of China developing a military presence in El Salvador or Russia developing one in Nicaragua is both real and, for now, very preventable.

A second lesson from Afghanistan is that nation-building requires acute awareness of the relevant cultural and geopolitical context of the host nation, and it sometimes requires extraordinary patience. In Afghanistan, reconstruction involved transforming an agrarian, tribal, largely illiterate society with limited infrastructure into a Western-style democracy with a functioning criminal justice system, a military modeled after the U.S. (and thus reliant on the air support that Biden abruptly took away), and government and social institutions that respect fundamental human rights. It was always going to take considerable time and patience. The U.S. seemingly was the only NATO member nation not to comprehend this.

Nation building in Latin America does not require the same investment in treasury or military or diplomatic assets as Afghanistan. As El Salvadoran President Nayib Bukele said during a 2019 trip to the U.S., “We do not want aid, we want to do business with you.” Central America most needs an infusion of corporate capital coupled with security solutions in its ongoing struggle against transnational criminal organizations.

Biden’s Central America strategy should be applauded for recognizing the importance of corporate America in invigorating Latin American economies. But the U.S. should keep the $4 billion in foreign aid that Biden has proposed and instead use the corporate tax code to incentivize corporate investment. A model would be U.S. Sen. Tim Scott’s (R, SC) “Opportunity Zone” legislation, which targets economically distressed areas in the U.S.  Honduras implemented similar tax policy in recent years, creating “Free Economic Zones,” which has already resulted in the construction of a Nike factory that will employ 7,000 Hondurans. Tax incentives from the U.S. government would replicate that Nike factory many times over in Central America.

Private security solutions also exist in Latin America. The Biden strategy appropriately calls for increased bilateral law enforcement cooperation in combating organized crime. But U.S. law enforcement is no more a complete, long-term solution to Central American security challenges than the U.S. military proved to be in Afghanistan. Private security firms subsidized by the U.S. government would not only protect individual corporations investing in the region, but they could also modernize foreign law enforcement agencies to combat the transnational gangs and criminal organizations that threaten their future.

Success in Latin America requires the U.S. to learn from Afghanistan—to put its bureaucracy aside and to nation-build by unleashing the best of America: the free market ideals on which it was founded.