DURING two years in office Mexico’s president, Enrique Peña Nieto, has received sharply contrasting reviews at home and abroad. Foreigners, including The Economist, have praised his structural reforms of the economy, which include an historic measure to open up energy to private investment (see article). Yet polls show that most Mexicans dislike Mr Peña. Among other things, they blame his government for a squeeze on living standards and the interlinked problems of violent crime and corruption. Sadly, recent events have lent support to Mr Peña’s domestic critics.

On November 8th Mexico’s attorney-general announced what almost everyone had already concluded: that 43 students from a teacher-training college in the southern state of Guerrero, who disappeared in the town of Iguala in late September, had been murdered by drug-traffickers after being kidnapped by the local police on the orders of the town’s mayor. Guerrero has been Mexico’s most violent state for centuries. The federal government bears no direct responsibility for these events. But Mexicans see in them a symbol of the failure of Mr Peña’s administration to make security a priority.

Now comes a problem that is uncomfortably close to home. The government had already opted to cancel a contract for a high-speed train that it had hastily awarded to the sole bidder, a consortium of Chinese and Mexican companies including a construction firm from the president’s home state. A local journalist has revealed that the boss of the same firm owns a $7m mansion that is the Peña family’s private residence (see article). The president denies any wrongdoing, but a common thread runs through these events.

Mexico only became a democracy in 2000, when seven decades of rule by the Institutional Revolutionary Party (PRI), the political machine that raised Mr Peña, were ended by electoral defeat. Unfortunately, democracy did not bring the rule of law to Mexico. Too many in the PRI still see the job of the police and the courts as enforcing political control, rather than investigating mobsters. Corrupt politicians are protected rather than punished. Organised crime and graft both remain a part of everyday life, and neither has been helped by the drugs flowing north to the United States.

Some things have changed. The Supreme Court now operates professionally. A 41,000-strong federal police force is more capable than most of its local counterparts. Felipe Calderón, Mr Peña’s predecessor, weakened the drugs gangs, but at the price of a surging murder rate and unchecked abuses by the security forces. On paper, Mr Peña has a grand crime-prevention strategy. However his real efforts have been focused on the economy. The murder rate may have fallen back slightly, but extortion and kidnappings have not. Tycoons practise espionage and bribe judges. For many Mexicans, Iguala was a reminder of the gap between justice for the poor and for the rich.

How to end impunity

Mr Peña’s people rightly say that the rule of law cannot be imposed in Mexico overnight. But that is no excuse for inaction today. Iguala is not the only town where criminals run the police: in such places, the federal government should take temporary control of the police and administration. Mr Peña should lead an effort to clean up state police forces and local courts. A bill to make the attorney-general’s office independent and to create an anti-corruption agency should be fast-tracked. Federalism in Mexico needs change, too: states and municipalities raise almost no funds of their own and are not held to account for their spending. It is an indictment of all three main political parties that the elements in Mr Peña’s reform pact to make politicians accountable have yet to be approved.

However impressive Mr Peña’s economic reforms, Mexico will never manage to achieve its considerable potential without an honest, efficient criminal-justice system. Its democracy will lose legitimacy if its politicians continue to tolerate graft. Mr Peña’s domestic critics say that he is a skin-deep moderniser, steeped in his party’s bad old ways. Now is the time for him to prove them wrong.