The Aug. 25 attack on a casino in Monterrey, Mexico, might have been the deadliest massacre in the government’s five-year war against drug traffickers. It is unlikely to be the last.

More than 50 people were killed when a group of armed men entered the Casino Royale at about 3 p.m., ordered everyone to leave, doused the building with gasoline and set it ablaze. The attack took less than three minutes.

It’s not certain which of Mexico’s drug cartels was responsible, although it hardly matters. Immediately after the attack, Mexican President Felipe Calderon -- who until now had rejected characterizations of his country’s endemic drug violence as terrorism -- called it “an act of terror and barbarity,” and those responsible, “true terrorists.”

Calderon declared war on the cartels in January 2007. Had he failed to act then, the drug lords’ power and influence would have grown big enough to threaten the Mexican state. Since the war began, as many as 40,000 Mexicans have been killed. But whichever way the government characterizes those responsible -- as terrorists, criminals or miscreants, -- it is more important that Mexicans and their U.S. neighbors take a step back, understand the nature of Mexico’s war against the drug gangs and take appropriate measures to win it.

Foreign analysts sometimes argue that Mexico’s drug war is a type of insurgency, and then compare it to Colombia’s. In fact, it is fundamentally different. The cartels are criminal gangs whose only goal is to run their businesses and take over as much of the lucrative narcotics trade as possible. Unlike the “narco-guerrillas” in Colombia, they have no political agenda, are not allied with militant groups that do, and have shown no ambition to control territory or build a government structure in areas where they operate.

Many Mexicans believe that the U.S. is responsible for the rise of the drug cartels. That is also wrong. Although Calderon is probably the most pro-American president in Mexico’s history, he is still willing to blame the U.S., at least partly, for Mexico’s troubles. Within hours of the attack, while acknowledging that the two countries are “neighbors,” “allies” and “friends,” Calderon said the U.S. must stop the “indiscriminate” sale of assault weapons to Mexican gangs and claimed that “the economic power and firepower of the criminal organizations operating in Mexico and Latin America come from this endless demand for drugs in the United States.” The Americans, he said, “share responsibility.”

It is true that, according to some estimates, 70 percent of the weapons used by Mexican drug gangs are smuggled across the American border and that the U.S. must do much more to stop the illegal gun trade. It is also true that American demand for narcotics fuels Mexico’s drug business. But if easy access to guns were the cause of Mexico’s predicament, then Texas would be as lawless as Chihuahua. If a border with the U.S. drug market were the problem, then Canada would also be fighting such gangs.

So if Mexico’s internal strife is not an insurgency and not primarily the U.S.’s fault, what is it? One possibility is that it is the result of decades-long corrupt and incompetent government, popular contempt for the rule of law, a weak civil society and a growing gap between rich and poor. These conditions created a state that is unable to enforce its laws, provide services or opportunities for its poorer citizens, or create a sense of community across regional or class boundaries. Seen this way, the current drug violence might be a symptom of more fundamental problems afflicting Mexican society.

So far, Calderon has relied exclusively on the Mexican army and a reformed police force to defeat the cartels. The U.S. has supported this strategy by significantly increasing cooperation with Mexican law-enforcement authorities. For fiscal year 2012, the Obama administration has requested almost $329 million in assistance for Mexico, about 80 percent of which will go to the police or the armed forces. But as Calderon enters his last year in office, victory over the cartels is as elusive as ever.

Training and equipping Mexico’s security services are vital to defeating the drug gangs. But internal conflicts are rarely won by military means alone. The Mexican government also needs to establish the rule of law, strengthen social cohesion, act against corruption, and provide decent education and economic opportunities for Mexico’s poor.

Calderon deserves credit for identifying the cartels as a threat to Mexico’s future. He has a final chance to make progress in the drug war and lay a foundation that his successor can build on. He should do so by putting Mexico on the path toward a more just and law-abiding society.

To contact the Bloomberg View editorial board: view@bloomberg.net.