In the rise of Mexico’s next president, a populist who channeled a nation’s anger at mainstream politicians, some here saw a glimmer of another North American firebrand.

Andrés Manuel López Obrador, a longtime fixture of Mexico’s left, is no Donald Trump. But the wave of dissatisfaction that carried him to power, with millions of voters seeking the most anti-establishment candidate they could find, sure looks familiar.

“It’s a referendum on the way government has been run,” said Andrés Rozental, a retired career Mexican diplomat. “It’s not unlike what happened in the U.S. in 2016.”

Eighteen years after the end of one-party rule, the election of López Obrador makes one thing clear: Mexico’s democratic experiment has failed vast swaths of the country.

That period yielded three unpopular presidents and a continued ebbing of confidence in public institutions like the security forces and the judicial system. The rallying cry that won López Obrador the election wasn’t against Trump or the country’s drug cartels. It was against Mexico’s mainstream politicians — “the mafia of power,” he calls them.

“Mexican voters are choosing someone who will kick the table instead of simply resetting the dinnerware,” said Arturo Sarukhan, a former Mexican ambassador to the United States.

It is difficult to predict how López Obrador will govern — as the incendiary leftist who roared across the campaign trail or the pragmatic leader who once led Mexico City as mayor. He’ll face a wide range of challenges in carrying out his agenda.

It won’t be easy to vanquish corruption, as he’s promised, or to fund the social programs his supporters are counting on. He is inheriting Latin America’s second-largest economy at a time when its chief trading partner — the United States — threatens to continue increasing tariffs.

What is clear is that the Mexican election turned into a referendum on mainstream political parties’ efforts to address the most basic demands of their citizens — and they failed. Every year since 2000, when the Institutional Revolutionary Party (PRI) lost its first presidential election in seven decades, Mexican politicians from mostly centrist parties promised to crack down on corruption and improve security. Yet corruption has deepened, and security has worsened.

Some analysts argue that the malfeasance and self-dealing that pervaded 70 years of one-party rule by the PRI are dyed into the fabric of Mexican governance.

The six-year term of outgoing president Enrique Peña Nieto is full of examples that speak to that point. When 43 students were kidnapped in the southern town of Ayotzinapa, a case that blossomed into a national scandal, his administration covered up the likelihood that they were tortured, according to a United Nations report. Members of Peña Nieto’s party have been accused of stealing millions of dollars from government coffers. His approval rating dropped to as low as 12 percent.

“There is an incredible sense of self-preservation and preservation of the system. They still believe they can spin people and cover up and torture people into confessing crimes they didn’t commit and no one will know,” said Eric Olson, deputy director of the Latin American Program at the Wilson Center, a Washington think tank.

In 2000, when Mexico elected its first non-PRI president, many saw hope in “alternancia”— the ability to vote out the ruling party. But the National Action Party (PAN), which produced consecutive presidents Vicente Fox and Felipe Calderón, did not fulfill the hopes of Mexicans for a multiparty democracy.

If Americans chose a political outsider in 2016 in part because they saw Washington as indifferent to the plight of the working class, Mexicans reacted to successive governments’ failure to reduce corruption and insecurity.

“Democracy has meant more deterioration than improvement: in terms of economic performance, in terms of justice and equality, in terms of security, in terms of corruption and impunity,” said Carlos Bravo Regidor, a political analyst from Mexico’s Center of Economic Investigation and Studies. “Democracy has not delivered the fruits it promised.”

Against that backdrop, López Obrador ascended. He came close to winning the presidency in 2006, but this year, he quickly built an insurmountable lead.

Mexican presidents have made some efforts in recent years to build stronger institutions. The government has attempted to carry out a profound overhaul of the country’s legal structure, substituting public trials for a secretive process involving written arguments, and turning the notoriously ineffective police into proper investigators. But the reform has been impeded by confusion and a lack of training and preparation.

Last year, Mexicans reported less than 7 percent of crimes, according to the Global Impunity Index, compiled by academics gauging the problem in Latin America. Even judges and prosecutors have said that they don’t believe in the effectiveness of the justice system.

The government has at times been hamstrung by powerful drug cartels connected to international trafficking rings, and it lacks some of the control over governors and local security forces that it had under the PRI system.

Corruption has long been a problem in Mexico, but many citizens feel it has spiraled out of control. A study by the Mexican Institute for Competitiveness (IMCO) estimates that roughly 5 percent of Mexico’s GDP is lost to corruption annually. Nearly 60 percent of Mexicans work in the informal sector, often with low wages and without benefits, as the country’s political elite build second and third homes.

At rally after rally, López Obrador fixated on the question of corruption and injustice.

“This official banditry is going to end!” he screamed at one rally.

Unlike Trump, López Obrador is no political outsider, but a career politician who has managed to burnish his image as incorruptible and authentic. He drives an old Nissan and lives in an unremarkable house. He claims to not have a credit card or checking account.

But while López Obrador has diagnosed Mexico’s deep problems with corruption, he has not articulated a coherent anti-corruption platform. Instead, he presents his own personal austerity as a kind of model for public service.

His team has echoed the personality-driven aspect of his campaign.

“Since I met López Obrador in 2006, I felt he was the type of social leader that emerges two or three times a century, no more,” Héctor Vasconcelos, who is set to be his foreign minister, said in an interview.

But even if López Obrador has the right message at the right time, his administration will now face the challenge of fixing deep-rooted structural problems, with expectations that many believe are unrealistic.

“The social contract in Mexico is broken,” Sarukhan said. “It will not be easy to repair.”

Joshua Partlow in Mexico City contributed to this report. Read more: