IT TAKES guts to challenge both Andrés Manuel López Obrador, a messianic, silver-tongued populist, and the residual political machine of Mexico’s governing Institutional Revolutionary Party (PRI). Ricardo Anaya is as daring as he is ruthlessly ambitious. Having forged a coalition of his own conservative National Action Party (PAN) and two small centre-left outfits, Mr Anaya argues that the presidential election on July 1st is now a two-horse race between himself and AMLO, as Mexicans call Mr López Obrador, the long-standing front-runner. Several opinion polls support that contention. The question that will hang over Mexico during the next four months is whether, in his sharp-elbowed ascent, Mr Anaya has made too many enemies to unite the disparate majority that dislikes AMLO and thus win the presidency.

On the face of things, this is AMLO’s election to lose. Mexicans have rarely been so gloomy or wanted change more. The PRI government of Enrique Peña Nieto is unpopular. Although it achieved important reforms of education and energy, it has failed in fighting violent crime and corruption and improving the economy, the issues that matter most to the public. When the PAN ruled Mexico in 2000-12 it didn’t do much better. That means “there’s less resistance” to AMLO than in 2006 and 2012 (when he nearly won the presidency), says Jorge Castañeda, a former foreign minister.

In those campaigns he ran as a rabble-rouser bent on returning Mexico to its protectionist, nationalist past. His friends insist that he has mellowed. He has made overtures to business and to Mexico’s capitalist north. His pledge to review all contracts issued to private energy companies doesn’t mean rejecting them, according to Alfonso Romo, a businessman from Monterrey who advises him. Mr Romo stresses AMLO’s concern for the “forgotten Mexico” of the poor and the indigenous. But AMLO has also opened his tent to allies from reactionary, corporatist parts of the PRI (to which he belonged from 1976 to 1988). He has talked of an amnesty for drug barons. “He can no longer hold the banner of fundamental regime change,” says Denise Dresser, a political scientist.

Neither can the PRI’s candidate, José Antonio Meade, a competent and respected former finance minister who is not a party member. He makes a virtue of his lack of a political background. But “the scale of the well-deserved repudiation” of Mr Peña makes Mr Meade’s task “impossible”, says Enrique Krauze, a historian.

It is Mr Anaya who offers the best hope of defeating AMLO. He is only 38. With his crew cut and glasses, he looks like a school swot. He is a formidable debater and political operator who speaks with a laser focus. “This is a very close election between two options for change,” he told Bello. “The question…is what kind of change [Mexicans] want.” AMLO proposes change “with ideas that are very old, trapped in the past”, he says, while his own ideal is a modern democracy open to the world and to new technology.

For example, AMLO promises to cancel construction of a $13bn airport now being built near Mexico City. He would reverse the education reform, which holds teachers accountable by evaluations. AMLO doesn’t want to turn Mexico into a Marxist dictatorship like Cuba or Venezuela. But he wants to be friends with those countries, says Mr Castañeda. AMLO vows to fight corruption but promises to slash the salaries of senior officials, which is a recipe for graft.

Mr Anaya argues that to impose the rule of law stronger institutions are essential. He wants the attorney-general’s office, over which the president has sway, to be fully autonomous. He would fight drug gangs with better intelligence. To tackle poverty he would introduce “gradually” a universal basic income (though voters might prefer more and better jobs).

Mr Anaya seized control of the PAN from more experienced rivals and oversaw its victory in several gubernatorial elections. He says he doesn’t defend the mistakes of past PAN presidents, and anyway he represents a coalition. Quite how coherent this coalition of convenience will prove is an open question.

He faces other obstacles. His merciless attacks on the PRI are a double-edged sword. If Mr Meade has no chance of victory, “it’s easier for priistas to go with AMLO than this güero [fair-haired boy]”, says Mr Krauze. Mr Anaya’s biggest difficulty may be that in his single-minded pursuit of the candidacy he has alienated important figures in his own party, starting with Margarita Zavala, the wife of a former president, who is running as an independent. To win, Mr Anaya must be a healer as well as a fighter.