The January 2016 recapture of fugitive Sinaloa cartel boss Joaquin “El Chapo” Guzman illustrates more than just the poor judgment of Sean Penn and the presumed high-level corruption that facilitated El Chapo’s July 2015 escape. The affair also highlights the capabilities and limits of the Mexican Armed Forces, and how the close, but troubled, Mexico-U.S. relationship has evolved in the decade since December 2006, when former president Felipe Calderon launched the war against the cartels by deploying the Mexican Army into the state of Michoacán.

The bonds of geography that have facilitated migration and economic interdependence between the U.S. and Mexico have also produced an inescapable matrimony between the two countries which, over the years, has simultaneously brought intimacy and conflict.

The populist anti-Mexican rhetoric of Donald Trump has very publicly highlighted the basest fears of some in the U.S. regarding its neighbor to the south: crime, violence, and immigration absorbing U.S. jobs and public resources.

Yet many in the U.S. do not appreciate the extent to which Mexico’s modern identity has also been defined by negative facets of its relationship with the U.S.: the 1846-1847 war in which Mexico was forced to cede almost half of its national territory to the U.S.—including land from California to Texas—the 1914 U.S. occupation of the Mexican port city of Veracruz, and General John Pershing’s 1916 raid into northern Mexico in pursuit of Pancho Villa, among other episodes. Indeed, contemporary Mexican military cooperation with the U.S. in the war against organized crime has had to overcome the fact that an important part of the institutional history of the Mexican Armed Forces revolves around fighting the United States.

Beyond such history, 80,000 Mexicans have died in the past decade in the struggle against and between organized crime groups. The U.S. demand for drugs which has empowered the cartels, and the fact that the U.S. is the primary source of arms that have killed so many Mexicans is a sensitive issue south of the border. Nor has the relationship been helped by the legalization of marijuana in U.S. states, when Mexican military and law enforcement officers have given their lives to stop narcotraffickers from moving drugs across the U.S. border.

Despite such challenges, the expansion of U.S.-Mexico security cooperation since the beginning of the Calderon administration has been impressive. On the U.S. side, the working relationship allowed a generation of military leaders and personnel to come to know and respect their Mexican counterparts as a capable organization of professionals. During this time, collaboration with the Mexican Navy (SEMAR) was arguably closer than with the Army (SEDENA), but both have advanced substantially, with the head of U.S. Army North, LTG Perry Wiggins, reported to have a very positive relationship with the head of the Mexican Army, General Salvador Cienfuegos.

The expanded U.S.-Mexican security relationship arguably ran into difficulties with the assumption of power of Enrique Peña Nieto in December 2012. The incoming president re-organized the nation’s public security apparatus, moving the federal police and the penitentiary system under the Interior Ministry (Gobernación), led by Miguel Ángel Osorio Chong, a confidant of President Peña Nieto and an old guard leader within the ruling Institutional Revolutionary Party (PRI). The Peña Nieto administration also required all security cooperation between the U.S. and Mexico (which had involved a broad array of direct interactions between U.S. and Mexican agencies under President Calderon) to now go through Gobernación as well, giving the ministry enormous power as a gatekeeper, but also creating a bottleneck.

Despite the limitations of the new arrangements, and the historically-based distrust of many of the old-guard PRI toward with the United States, close U.S.-Mexico security cooperation continued under President Peña Nieto. While Mexican sensitivities dictate that U.S. forces do not maintain a presence on Mexican soil, there has developed a high level of cooperation between the two countries with respect to professional military education, training, operational collaboration, and arms sales. Indeed, the Mexican Armed Forces have today become, by far, the largest purchaser of U.S. military equipment in the hemisphere, with over $1 billion in acquisitions during 2014, including $556 million in military trucks and $110 million in Blackhawk helicopters.

While the U.S.-Mexico security relationship has advanced, much work remains to be done with respect to deepening cooperation, and changing attitudes on both sides of the border.

The problem of drugs and transnational organized crime is more than a matter of law enforcement cooperation and U.S. security assistance for Mexico. It is a shared threat. A July 2015 report by the U.S. Drug Enforcement Administration, for example, highlights the worrisome, but little-discussed, reality that Mexican cartels such as Sinaloa and Juarez have an extensive presence throughout the United States, as well as in Mexico itself. Although Mexican cartels and gangs are not killing each other and battling law enforcement in the U.S. with the same brazenness that they are doing so in Mexico, corruption and illicit activity arguably does not stop at the border.

In Mexico as well, the organized crime problem is evolving in troubling ways.

Despite its publicly declared intention to refocus Mexico’s security strategy toward crime prevention and the reduction in violence, the Peña Nieto administration has substantially pursued the same strategy against the leadership of the cartels pursued during the sexenio of Felipe Calderon, with an unpublished list of 122 “most wanted” crime figures.

The current administration arguably has achieved important successes in this regard—beyond the multiple captures of “El Chapo”—including the 2015 captures of Servando “La Tuta” Gomez (Knights Templar), Miguel Angel Trevino (Zetas), and the capture of Héctor Beltrán-Leyva in 2014. Under Peña Nieto, Mexican law enforcement has substantially weakened the Zetas cartel, and to a lesser extent, La Familia Michoacana and the Knights Templar organization. Yet in the process, the cartels have become substantially more fractionalized, with splinter groups and paramilitary organizations originally created to enhance the firepower of the cartels, such as the Zetas (originally created by the Gulf Cartel), La Linea (Juarez), and the Mata Zetas (Gulf Cartel) proliferating, increasing not only bloodshed, but also criminality. These new groups have turned to non-drug criminal activities like kidnapping and extortion to sustain themselves.

Equally troubling, the one-time balance of terror between the cartels in Mexico may be giving rise to a powerful new alliance. While violent cartels such as the Zetas, La Familia, and Knights Templar fought each other and the Mexican government, El Chapo’s Pacific-focused Sinaloa cartel, with a highly federated structure and a posture of avoiding conflict with authorities, came to eclipse its peers in international reach and income, with estimated annual earnings of at least $3 billion.

At the same time, the cartel Jalisco Nueva Generación (CJNG) allied with Sinaloa through familial relationships and a history of collaboration among its top leaders, built a similarly formidable organization, while remaining below the radar screen by avoiding substantial involvement in the U.S. market. In one month, CJNG demonstrated its quietly accumulated power with a high-profile April 2015 blockade of the roads leading to Guadalajara, one of Mexico’s principal cities, the ambush and murder of 15 Mexican federal police officers sent to respond, and a firefight in which the group downed a Mexican Army helicopter.

Although Mexico’s National Security Commissioner Monte Alejandro Rubido later declared that the government would make CJNG a priority target, the government’s campaign has achieved surprisingly few public successes against the group to date. More important, the Sinaloa-CJNG alliance, augmented even more by a looser collaboration with the Gulf Cartel, has given the group a powerful collective presence across Mexico that eclipses the other cartels such as the Zetas, the Juarez Cartel, La Familia Michoacana, Knights Templar, and the Beltran Leyva organization.

The shared challenge of transnational criminal organizations makes it vital that the U.S. continue to work with Mexico as a key partner in the security arena, rather than as a failed state. While Mexican state and law enforcement institutions have serious problems, actions such as the October 2015 U.S. withholding of $5 million in security assistance to Mexico over human rights concerns only undercuts Mexico’s efforts against organized crime, while impeding the construction of a respectful peer-to-peer relationship.

The path forward for the U.S. and Mexico to confront the shared threat of transnational organized crime is not more U.S. aid, but rather closer collaboration in areas from joint operations to intelligence sharing. Being serious about peer-to-peer collaboration with Mexico means not only helping Mexico fight cartels on its national territory, but also greater collaboration with Mexican authorities in combatting the distribution and sales networks of Mexican cartels operating on U.S. soil, as well as working more closely with Mexican authorities in the U.S. to shut the border and maritime routes to criminals who illegally smuggle firearms purchased in the U.S. into Mexico.

To take matters one step further, it is time to consider publicly collaborating with the Mexican government in efforts to reduce drug consumption within the United States.

There is arguably no other foreign country whose economic and institutional health and cooperative disposition is more vital to U.S. national security than Mexico. As with all marriages of many years, in its relationship with the U.S., Mexico is familiar with both the nobility and the defects of its partner to the north. In the interest of our shared prosperity and security, it is important that we show Mexico more of our better side.

The author is Latin America research professor with the U.S. Army War College Strategic Studies Institute. He would like to thank those who provided important inputs into this article, including Roger Noriega and Duncan Wood.