IN APASEO EL GRANDE, a town in the central Mexican state of Guanajuato, the bodies are stacking up. In February gangsters killed a local politician. The remains of another victim were found in four bags scattered across town. Police made a similar discovery in April. In the first three months of this year the municipality of 85,000 people had 43 murders, up from 20 in all of 2016. That is about the same as London, a city 100 times larger and currently panicking about its high murder rate.

A visitor might not notice anything amiss. Shiny cars made in nearby factories cruise the streets and children play in the main square. But residents are frightened. Bouncing a child on his knee in his living room, Efraín Rico Rubio, a former city councillor, now an administrative worker at a university, describes the violence. “Three blocks down they killed someone,” he says, “and three blocks in the other direction.” He sees little prospect of improvement. Schoolchildren “all want to be El Chapo”, a drug baron who became a folk hero by escaping twice from prison. (He was caught again in 2016 and extradited to the United States.)

The town and the state it belongs to are suffering from a double blow. One is a national crime wave, during which the murder rate broke through its previous record of 2011. That peak came after the then president, Felipe Calderón, deployed the army to fight drug gangs. His tactic of capturing or killing kingpins caused the gangs to split into warring factions and to enter new lines of business. The current president, Enrique Peña Nieto, who took office in 2012, promised to halve the murder rate. Instead, after an initial decline it rose sharply (see chart). By March this year the number of murders during Mr Peña’s presidency had exceeded the death toll under Mr Calderón. The murder rate so far in 2018 is around 25% higher than it was in 2011. Guanajuato’s second problem is that it is new to such violence and thus less prepared for it. In 2011 its murder rate was half the national average. Now it has soared to double the national rate. The rise in violence is among the main issues in the general election scheduled for July 1st. Nearly half of Mexicans say crime is the main problem in their area. The disappearance of three film students in Guadalajara in March, and the discovery that their bodies had been dissolved in acid, sparked large protests last month. The first of three debates among five presidential candidates, held on April 22nd, began on the theme of security. Their proposals were not encouraging. Andrés Manuel López Obrador, the leftist front-runner, misdiagnosed the problem. His proposed solutions are radical but, at best, part of the answer. His two main rivals were vague. Guanajuato’s prosperity, once thought to deter crime, now seems to be attracting it. The state’s south is part of an industrial corridor that stretches from Aguascalientes to Querétaro. Factories in the region produce cars and other goods for tariff-free export to the United States and Canada under the North American Free-Trade Agreement. A quarter of Guanajuato’s workforce is employed in manufacturing.

Gangs from nearby Jalisco and Michoacán moved into the state from 2015. They are not led by El Chapo-style narcos. They make most of their money from theft and extortion. Some of the loot, including grain, car parts and furniture, is hijacked from trains bound for the United States. The biggest money-maker is fuel theft. Nearly a fifth of recorded cases occur in Guanajuato. The country-wide cost of this to Pemex, the state-controlled oil firm, is more than 30bn pesos ($1.6bn) a year.

Huachicoleros, as the thieves are called, fight each other and oil-industry workers for control of pipelines, just as drug gangs war over highways, border crossings and street corners. A politician in Guanajuato claims that 80% of murders in the state are related to fuel theft. In January the head of security at an oil refinery in the city of Salamanca was killed. Car theft can also be lethal. In 2011 less than 2% of the state’s vehicle thefts involved violence, according to government data; last year 26% did.

Mexico’s location, between South America’s coca fields and the United States’ drugs market, makes it vulnerable. But the persistence of violence is the fault of a weak state, and especially of inadequate policing, prosecution and courts. Widespread corruption greatly worsens the problem (see article). Rather than correcting those defects, recent governments have cracked down ineptly.

Police investigate just a quarter of murders. In part that is because there are too few police. The interior ministry has set a target of 1.8 police for every 1,000 people. Only Mexico City and the state of Tabasco have met it. Police and officials are underpaid, and thus tempted to work for criminals rather than against them. They are also poorly trained. In many states, more than 90% of arrests are of suspects caught red-handed, which shows that police have little capacity to investigate crimes more than an hour or two after they happen.

Another problem is co-ordination. Mexico has municipal, state and federal police forces, plus the army, which Presidents Calderón and Peña pressed into service against criminals. In many states municipal and state-level police do not use the same radio frequencies and therefore cannot communicate. The army resents being asked to chase domestic criminals, a job it thinks the police should do. Municipal police, used to issuing traffic tickets and pursuing burglars, find themselves investigating fuel theft, which is a federal crime.

Areas where violence has surged recently are especially unprepared to deal with it. Guanajuato has one forensics specialist per 10,000 crimes; the national average is 18. Police numbers there are less than a quarter of the interior ministry’s standard. While the number of murders in Apaseo El Grande has risen tenfold since 2015, the number of municipal police has increased by just ten, to 100. Ricardo Ortiz, the mayor of nearby Irapuato, says that many policemen are threatening to quit to earn more than their miserable average wage of 14,000 pesos a month.

Mr Peña’s efforts to improve policing have largely failed. He proposed creating a 40,000-strong force that would establish control over areas infested by crime. But the government cut back its funding and the army refused to let civilians command it. The force now has fewer than 5,000 troops. Both Mr Calderón and Mr Peña tried to raise standards and solve the co-ordination problem by introducing “mando único” (single command), the takeover of the country’s 1,600 municipal police forces by the 32 state forces. But congress blocked Mr Peña’s plan to make this compulsory. States have adopted it in piecemeal fashion, with mixed results. In Apaseo El Grande, where 30 state and 33 military police showed up at the turn of the year to cope with the surge in murders, patrols stopped briefly because of a mix-up over the force’s fuel budget. More worryingly, frets the mayor, Gonzalo González, the state and federal police don’t know the region.

A more promising initiative is a reform of the criminal-justice system, which is taking place gradually across the country. This shifts courtroom procedures away from document-based decision-making by a judge to argumentative methods used in the United States. This makes it harder for prosecutors to obtain a conviction (in the few cases that go to trial). In the long run it should improve law enforcement by obliging police to work harder to obtain evidence. But politicians complain that the new procedure, plus a new law that prevents police from locking up people caught with illegal weapons, is allowing more criminals onto the streets.

The presidential candidates have presented plans that are old, vague or inadequate. The two main moderate candidates, Ricardo Anaya of the conservative National Action Party and José Antonio Meade, the nominee of Mr Peña’s Institutional Revolutionary Party, see the need to improve law enforcement but say little about how they would do it. In the debate Mr Anaya criticised the priority that Mr Peña and Mr Calderón (a member of his party) gave to capturing kingpins. He promised to “dismantle and not just decapitate” criminal organisations. Mr Meade would “quadruple the state’s investigative capacity”.

Mr López Obrador, the strong favourite, regards criminal justice as a branch of economic justice. The root cause of violence, he argues, is a lack of opportunity. But that explains neither its nationwide rise nor its surge in prosperous Guanajuato.

The candidate’s new idea for reducing crime, apart from fighting poverty, is to offer an amnesty to low-level drug traffickers. In the debate he spoke of inviting Pope Francis to mediate between gangs and the state. “We cannot put out a fire with fire,” said Mr López Obrador. His rivals accused him of blessing the impunity that plagues criminal justice. “You want to forgive the unforgivable,” Mr Meade said.

Conciliation of some sort could help as part of a well-designed law-enforcement strategy. Benjamin Lessing, a political scientist at the University of Chicago, argues that gangs have no incentive to behave better if the state subjects them to “full, unconditional pressure”. The state should crack down hard when gangs overstep defined boundaries, he says. Using data to focus policing on the most violent areas, as Colombia has done, would also help. But such tactics require sophistication as well as toughness. It is not clear that Mr López Obrador has either quality.

In Guanajuato, still shocked by the recent spike in murders, his velvet-glove ideas are met with scepticism. “We cannot solve this in a nice way,” says Mr Ortiz, Irapuato’s mayor. Three-quarters of voters oppose the idea of amnesty. But in areas with bloodier histories they may be more receptive. “It is very different if you live in Tamaulipas, Guerrero, Michoacán or some state that is very affected by drug-trafficking,” said Francisco Abundis, a pollster, in a recent television interview. Mr López Obrador thinks he can persuade gangsters to lay down their arms, and voters to forgive them. After the bungled crackdowns by previous governments, Mexicans may give him a chance.