As in Somalia, warlords have taken over large swaths of the country, and the central government’s writ has little meaning in certain regions. As in postwar Iraq, sectarian violence and outright warfare have claimed tens of thousands. As in Afghanistan, the chaos is beginning to spill across the border, claiming lives in neighboring countries. And as in so many broken places around the world—from Southwest Asia to Africa—the United States is trying to help.

Unlike those faraway failed states, however, the one described here shares a border with the United States.

Some look at Mexico’s bloody drug war and see it as proof that the Mexican government is standing up to the cartels. Others look at Mexico and see a nearly failed state that directly threatens the American people.

Descent into ChaosBefore scoffing at the notion that Mexico is on the precipice of failed-state status—or that it might require direct U.S. intervention—consider this: In 2008 the U.S. Joint Forces Command issued a report challenging policymakers to prepare for a worst-case scenario involving the “rapid and sudden collapse” of Mexico, adding, “Any descent by Mexico into chaos would demand an American response.”

With 40,000 people killed, the descent has arguably already begun. Foreign Policy magazine reports that almost half of the dead have been killed in Mexican states bordering the U.S., a reality made all the more unsettling by reports that 125 cross-border tunnels have been discovered running from Mexico to California and Arizona.

As the Joint Forces report concludes, “An unstable Mexico could represent a homeland security problem of immense proportions to the United States.”

In light of that, small contingents of U.S. forces—and large amounts of U.S. aid—are pouring into Mexico. Under the $1.5-billion Mérida Initiative, the U.S. has been delivering economic and military aid focused on Mexico’s drug war efforts since 2008. Mérida resources are used to train Mexican government agencies and officials in law enforcement, the rule of law, counter-narcotics and military-security measures. Some 20,000 Mexican law enforcement and judicial officials have been trained under the Mérida Initiative, including prosecutors, police officers and judicial officials.

Closer to the frontlines, the U.S. and Mexico have created joint fusion centers to manage, collect and act on intelligence related to counter-narcotics efforts. In addition, Washington has enlisted Colombia to play a major role in training Mexican forces.

Direct military assistance represents only a tiny fraction of U.S. involvement. But given the troubled history between the U.S. and Mexico, even modest amounts of U.S.-Mexico military cooperation are remarkable. “A sea change has occurred,” as Mexico’s ambassador to the U.S. Arturo Sarukhan puts it. U.S. military involvement has been limited to a few Black Hawk helicopters, UAVs and small numbers of trainers. The U.S. military deploys about 20 training teams into Mexico each year, USAToday reports. No larger than five-man units, these teams leave a small footprint and do not participate in military operations.

However, with Mexico’s blessing, the U.S. is steadily expanding military-related activity south of the border: The New York Times recently revealed that CIA operatives and retired military personnel have been dispatched to Mexico, and that Washington has authorized Mexican security forces to use U.S. territory as a staging area for operations into Mexico. In addition, the U.S. is considering deploying U.S. military contractors alongside Mexican police units.

Third FrontWorryingly, U.S. training teams in Mexico say they are applying what they have learned fighting insurgencies in Afghanistan and Iraq. In fact, Rep. Ted Poe (R-Tex.) has described the U.S.-Mexico border as “our third front, after Afghanistan and Iraq.”

Poe and Joint Forces Command are not alone in thinking about Mexico in a military-security context:

• Secretary of State Hillary Clinton has expressed worries that Mexico is tumbling toward a “narco-insurgency.” Hoping to forestall that, she recently traveled to Guatemala to hammer out a security plan to help Central American countries fight the drug armies. • Secretary of Homeland Security Janet Napolitano has raised concerns of collaboration between the cartels and Islamist terrorists. “We have, for some time, been thinking about what would happen if, say, al Qaeda were to unite with the Zetas” cartel. • The Pentagon and Department of Homeland Security began deploying unmanned drones into Mexican airspace in early 2011. • With his country besieged by Mexico’s narco-armies, President Alvaro Colom of Guatemala says it’s time to create a region-wide defense against the cartels. “What good is it if the forces of one country are pursuing drug traffickers who cross a river but then have to stop to avoid an international incident? Why not have a type of Central American NATO?”

Is militarization of the problem necessary? If the capabilities and actions of the cartels are any indication, the answer is yes.

The State Department reports that the cartels “increasingly employ military tactics.” Indeed, the cartels are effectively mini-armies, using mortars, snipers, rocket-propelled grenades, bazookas, land mines and even armored assault vehicles. As Colom observed after Guatemalan troops engaged a Mexican-based cartel that had taken over a swath of Guatemalan territory, “The weapons seized…are more than those of some army brigades.”

Not unlike al Qaeda, the cartels have attacked U.S. consulate employees, targeted and killed U.S. government agents, beheaded innocent civilians, detonated car bombs, seized ungoverned territory, terrorized local authorities into collaboration, cowed media outlets and killed thousands of Mexican citizens. The death toll has now eclipsed 40,000 in just five years. The body count includes 283 Americans.

Not ContainedTo put those numbers in perspective, 85,694 Iraqi civilians were killed between 2004 and 2008, according to the Iraqi government. That’s 17,139 per year. On an annual basis, Mexico’s total is in the 8,000 range, but it was 15,000 in 2010. The 2010 death toll and the overall toll are far higher than what prompted NATO intervention in Kosovo in 1999 or in Libya in 2011.

Equally worrisome, growing parts of Mexico are under the nominal control of the cartels:

• In Michoacan, home to the La Familia cartel, hundreds of citizens have been forced to abandon their homes as federal forces launch massive operations with helicopters and tanks. Corruption is rampant. Thirteen mayors and municipal officials have been arrested on drug charges. And there is no respect for legal authorities. Three police chiefs have been executed. • In one town in Chihuahua, fully half the population has fled. In fact, 441,000 homes have been abandoned in the states of Chihuahua and Tamaulipas due to drug-war violence, according to one study. • In Ciudad Juarez, a city of 1.3 million just south of El Paso, emergency response personnel have been targeted and slain by car bombs. In fact, in mid-2011, the U.S. Consulate issued an emergency message warning Americans that “a cartel may be targeting the U.S. Consulate in Ciudad Juarez” and could “utilize car bombs in attacks.” At least 3,100 of Mexico’s 15,000 narco-insurgency deaths in 2010 happened in Ciudad Juarez. • In Tamaulipas, the Zetas are threatening the oil fields. In fact, the cartels stole $750-million worth of oil in 2011, using it to fuel and fund their war. • In Mexico City, shielded from the drug war until 2011, military units in full combat gear have conducted daytime operations against drug cartels in middle-class neighborhoods. One of the Zetas founders was recently captured just an hour outside Mexico City.• Nationally, Mexico has dismissed more than 3,500 police officers due to corruption, according to the State Department. An estimated 1,700 Mexican army commandos have deserted since 2002.

The chaos is spreading. The Zetas and other Mexican drug cartels have begun using Guatemala as a base of operations. In May 2010, an army of 200 Zetas gunmen slaughtered 27 Guatemalan farmers. In response, Guatemala declared a state of emergency in its northern provinces and deployed military units to forcibly take back territory from the Mexican drug armies.

Mexican cartels are also operating in Honduras, where cocaine labs run by Mexican narco-armies have been uncovered, and in El Salvador, where Zetas training camps are located. Federal and local law enforcement agencies in the U.S. report that the Zetas have made inroads in Texas, California, New York and Maryland.

The Zetas are an especially worrisome cartel because of their background. The Zetas’ founding fathers were once members of an anti-narcotics commando unit that went rogue in the late 1990s. Today, they field a force of some 10,000.

As Clinton observes, “The cartels and criminals are not contained by borders and so therefore our response must not be either.”

Whether this all adds up to yet another reason to call a truce in the drug war is a subject for another essay. Suffice it say that the drug war may be unpopular in the United States, but there is no groundswell for legalization.

As for Mexico, President Felipe Calderon’s decision to target the drug lords did not create this problem, but rather exposed it. The threat was always there, like a ticking time bomb.

Good News, Bad NewsThe unraveling of the central government’s ability to provide security, population displacement, high levels of organized violence and corruption, intervention by foreign entities, violent and sustained challenges to state authority, border disorder—these are the telltale signs of a failing state. And they are on full display in Mexico.

In fact, the Failed States Index, an annual measure of the internal stability of countries around the world, places Mexico in the “borderline” category—not yet “in danger” but no longer “stable.” Since 2007, Mexico has fallen eight spots on the Failed States Index, which describes Mexico’s narco-insurgency as “extremely serious.”

Defeating the insurgency and pulling Mexico out if its slide toward failed-state status will take far more security-related resources than Mexico has invested to date.

As economic thinker Adam Smith noted long before anyone ever dreamed of a narco-insurgency, it is “the first duty of the sovereign” to protect its citizens from violence. In other words, the government must provide some modicum of internal order and security. Obviously, this should be aimed at promoting individual liberty rather than diminishing it, for both the anarchy of a failed state and the stifling order of an authoritarian state are at odds with liberty.

Calderon is trying to strike that balance, but his government clearly needs to invest more in defense. Mexico spent $4.86 billion on its military in 2010—just 0.5 percent of GDP. This is not nearly enough given Mexico’s internal security challenges. Consider the defense-spending levels of countries with similar challenges: Iraq invests 8.6 percent of its GDP on defense, Colombia 3.4 percent, Pakistan 3 percent, Afghanistan nearly 2 percent.

The results of Mexico’s inadequate investment in security and defense are neither surprising nor pretty: Low wages for the Mexican military—just two-thirds what Colombian soldiers earn—have made Mexican troops easy targets for corruption. The cartels are arguably better armed than the Mexican military. The Mexican people are under siege. And Mexico’s neighbors, to the north and south, are under increasing threat.

“Mexico has what we had some years ago,” says Colombian president Juan Manuel Santos. “What we can provide is the experience that we have had dismantling those cartels.”

The good news, as the Colombia example reminds us, is that with concerted effort, targeted resources and U.S. help, things can get better in Mexico. “We know from the work that the United States has supported in Colombia and now in Mexico that good leadership, proactive investments and committed partnerships can turn the tide,” Clinton recently observed.

The bad news is that if Mexico is being compared to the Colombia of the 1990s, it’s a mess. The worse news is that unlike Colombia, Mexico is right next door.