Not far from the US, a desperate leader is steering a once-prosperous democracy toward dictatorship.

Nicolás Maduro, the president of Venezuela, is scrambling to cling to power as his country is battered by an unprecedented economic crisis. And in the process, he’s becoming an autocrat.

Maduro is tossing political opponents in prison. He is cracking down on growing street protests with lethal force, with government security forces killing at least 46 demonstrators in recent months. He has repeatedly postponed regional government elections in order to stave off threats to his party’s power. And in July he held a rigged election for a special legislative body that supplanted the country’s parliament — the one branch of government that was controlled by his political opposition. The new superbody has carte blanche to rewrite the country’s constitution and expand his executive powers.

Maduro and his supporters now have total control of the government, and they’re showing no signs of slowing down.

It’s difficult to overstate how dire Venezuela’s economic plight is. The country entered a deep recession in 2014 spurred by the drop in global oil prices, and cumbersome regulations on its currency are helping produce record-breaking inflation. The International Monetary Fund estimates that prices in Venezuela are set to increase more than 700 percent this year. Seventy-five percent of the country’s population has lost an average of 19 pounds of bodyweight between 2015 and 2016 due to food shortages throughout the country.

But Maduro has done everything he can to prevent swelling popular discontent from limiting his power. His tactics place him among a special league of democratic authoritarians like Turkish President Recep Tayyip Erdoğan, who has used a referendum to expand the powers of his presidency, imprisoned political prisoners, attacked the judiciary branch of his government, and restricted free press in the wake of an attempted coup against him last year. Both leaders use crisis as a pretext for strengthening executive power while leaving the shells of their country’s democratic institutions intact.

For the US, Maduro’s increasing authoritarianism and refusal to reform his economy represents a major geopolitical and humanitarian challenge. The country’s total collapse would cause chaos in Latin America, creating an exodus of refugees to neighboring nations and likely exacerbating high crime rates in Central America and the Caribbean. (Thousands of Venezuelans are already fleeing to Colombia and, as of this year, Venezuelans top the list of asylum seekers in the US for the first time ever.)

So far, the Trump administration has tried using diplomatic and economic tools to pressure Maduro to drop his power grabs. In response to his decision to hold a vote for the new legislative body, Washington slapped sanctions on Maduro, many of his senior officials, and the country’s state-owned oil company this summer. Trump said in August that he wouldn’t rule out a “military option” to resolve the crisis in Venezuela, and just an hour after making the threat the White House issued a statement saying that he had refused to take a call from Maduro. “President Trump will gladly speak with the leader of Venezuela as soon as democracy is restored in that country,” the statement read.

While analysts don’t take Trump’s talk of a US military intervention seriously and the comments were at odds with National Security Adviser H.R. McMaster’s rejection of the option about a week prior, they do see it as a potential boon for Maduro. The US has a long history of hostility against socialist leaders in Latin America in general and in Venezuela in particular. Trump’s fiery rhetoric only gives Maduro a stronger public rationale for consolidating powers to fend off the American threat.

But Maduro’s expanding control of Venezuela’s institutions should not be mistaken for an expansion of real power. As the country’s economic crisis deepens and he becomes more tyrannical, he is alienating his own political base, according to experts. And his increasing reliance on appointing members of the military to power in his administration shows he doesn’t have unilateral sway over the government. Maduro’s heavy-handed tactics mask his deep strategic weakness.

Presidential elections in Venezuela are scheduled for next year, and a number of outcomes are possible. If they are actually held even somewhat fairly and the opposition unites in their participation in them, experts say it could be the end for Maduro — and a blow to the political revolution that brought him into power. Or in the face of a united opposition Maduro could double down on his repression — and push Venezuela even closer to dictatorship.

Venezuela’s new strongman lives in the shadow of its old one

Understanding Maduro requires understanding his predecessor Hugo Chávez, the populist firebrand who served as president of Venezuela from 1999 until his death in 2013 and spearheaded the country’s experiment with socialism.

Chávez is a legendary figure in Venezuela who transformed the country’s political and economic landscape by nationalizing industries and funneling enormous amounts of government money into social programs. Under his rule, Venezuela’s unemployment rate halved, income per capita more than doubled, the poverty rate fell by more than half, education improved, and infant mortality rates declined.

While he sparked ferocious opposition among the country’s elites and conservatives — who at one point attempted a coup against him — he was loved by the country’s poor and working classes.

He also won plaudits at home for his willingness to stand up to the United States — in 2009, he famously called then-President George W. Bush “the devil” during a speech at the United Nations.

“Yesterday, the devil came here,” he said, a reference to Bush’s speech at the UN the day before. “Right here. Right here. And it smells of sulfur still today, this table that I am now standing in front of.”

Chávez died of cancer at the age of 58, at the very beginning of his third term in office. Maduro, Chávez’s vice president and handpicked successor, temporarily assumed the office of the presidency, and was narrowly elected president in the elections that took place shortly after. He has been in power ever since.

Maduro has tried to replicate his predecessor’s political playbook. But he has largely failed. And a great deal of that can be traced back to two key assets that Chávez had that he likely never will.

First, Chávez was famously charismatic — a once-in-a-generation kind of political charmer with an extraordinary ability to persuade people from all different backgrounds to join his cause. Having grown up as a poor child in the Venezuelan countryside, Chávez had an organic and intuitive connection with the poor and working-class citizens he came to champion. A savvy politician, he cobbled together a coalition of leftists, military officers, broad swaths of the middle class, and Venezuela’s long-neglected poor.

“Chávez was an almost unclassifiable and unprecedentedly good politician,” George Ciccariello-Maher, a scholar of Venezuela at Drexel University, told me. “He had these incredible abilities and capacities that no one could be expected to reproduce.”

Chávez’s second special asset was an unprecedented oil boom, which poured about a trillion dollars into the country’s treasury during his tenure. High global oil prices have always been a boon for Venezuela, since it possesses enormous oil reserves. It’s a quintessential petrostate whose entire economic fate relies on the price at which the country can export oil to global markets. But Chávez expanded the state’s control over the oil industry and was ambitious in his efforts to redistribute the money it brought into government coffers.

Chávez had exceptional circumstances and abilities, but that didn’t mean he was above taking anti-democratic steps to tilt fortune even further in his favor.

He had serious authoritarian tendencies: He stacked the country’s courts with political allies, passed laws restricting the ability of journalists to criticize the government, and consistently sought ways to do away with checks on his power. But there were limits to his authoritarianism, and he thought of the electoral system as a key way to make himself more effective as a leader.

As New York University historian Greg Grandin has pointed out, Chávez “submitted himself and his agenda to 14 national votes, winning 13 of them by large margins, in polling deemed by Jimmy Carter to be ‘best in the world.’”

“Chávez was always careful to maintain electoral legitimacy,” Francisco Toro, editor of Caracas Chronicles, an opposition-friendly news and analysis site, told me. Toro says that Chávez had big advantages with friendly media and his tendency to use state money on his campaigns, but that he didn’t “steal or cancel elections blatantly.” Chávez even allowed his opposition to run a recall referendum against him in 2004 just two years after surviving a coup attempt. He won the referendum by a huge margin.

When Chávez picked Maduro to succeed him, it was because he expected Maduro to be an effective champion for his ideas after his death. But while Maduro shared a great deal with Chávez ideologically, he has not been able to repeat his political or economic success. Instead, he’s overseen Venezuela’s descent into economic catastrophe, lost swaths of Chávez’s committed political base, and become one of Latin America’s newest autocrats.

Maduro is trying to use a script that doesn’t work for him

About six weeks after Chávez died, Venezuela held a special presidential election. Calling himself the “son of Chávez” in a bid to capitalize on his predecessor’s popularity, Maduro campaigned on a promise to carry on Chávez’s legacy. And yet he barely edged out opposition candidate Henrique Capriles, taking merely 50.6 percent of the vote. Capriles, who had only days to prepare for the snap election, garnered more than 49 percent of the vote.

It was quickly apparent that Maduro was no Chávez.

“It’s not even that Maduro lacks Chávez’s incredibly charming ability to disarm and bring you into his fold — it’s that he tries to emulate it and it comes out as farcical,” Alejandro Velasco, a historian of Latin America at New York University, told me. “The way that he speaks, the way he gesticulates, he tries to embody Chávez, and it’s just so transparently not.”

It’s not that Maduro is lacking in leftist convictions. If anything, his background is more radical than that of Chávez, who came up as a military man and originally took office promising to lead Venezuela down a reformist path. Maduro studied in Cuba, was a member of the super left-wing Socialist League, and worked as a union negotiator before joining electoral politics in Venezuela as Chávez took power. He served as a member in the country’s National Assembly — its legislative branch — before serving as Chavez’s foreign minister for about seven years.

But Maduro never had the personality — or connections — that made him a natural fit to follow in Chávez’s footsteps. “It surprised people when Chávez picked Maduro as successor,” Miguel Tinker Salas, a Latin America expert at Pomona College, told me. “He wasn’t a figure really steeped in the internal dynamics of the Venezuelan political process.”

Maduro has not only been less adept at connecting with the public and persuading them of his policies — he’s also had less power within his own administration. This is because Maduro lacks “the personal magnetism that would allow him to boss around faction heads,” Toro says. What that means in practice is that Maduro feels compelled to do things like giving members of the military — a highly influential institution in Venezuelan life — powerful positions in his administration in order to neutralize the threat they may pose to his rule.

But in addition to being a poor politician, Maduro has lacked Chávez’s other exceptional asset for most of his time in office: oil money. After oil prices crashed in late 2014, Venezuela’s economy crashed with it.

Maduro won’t do what is needed to cure Venezuela’s addiction

Chávez was an innovator in how he spent money, but he did little to improve how Venezuela actually makes money. He paid no attention to diversifying the economy or investing in domestic production outside of the oil sector. The country relies on imports for many of its most basic goods and services, include food and medicine.

Since late 2014, low oil prices and stifling government regulations on currency have produced huge shortages of those basic items — including food and medicine — and caused the world’s highest inflation. The country is suffering from a malnutrition crisis. And malaria is ravaging the population despite the fact that Venezuela was the first country in the world to eliminate the disease in its populated areas.

It’s hard to lay the blame for this entirely on Maduro — Venezuela has long been addicted to oil and its economy has flourished or suffered based on oil prices since the early 20th century. But Maduro has failed to take any serious measures to mitigate the crisis by, for example, trying to crack down on corruption or ending the country’s currency exchange policy that is making it impossible for ordinary Venezuelans to buy everyday items.

The currency policy allows people who have government connections to exchange Venezuelan bolivars for US dollars at a special, extremely discounted rate. Those people then buy things like food abroad using those government-subsidized dollars and sell them domestically to people who buy them with the bolivar — and the sellers pocket the difference.

Maduro is ultimately too concerned with sticking to the Chávez script — and keeping the support of the government-affiliated elites who benefit from it — to consider serious reforms.

Maduro’s future is entirely up in the air

As Venezuela’s economy has collapsed, Maduro’s popularity has also plummeted, and protest movements have rocked the country. While Chávez’s approval ratings rarely dipped below 50 percent, Maduro has been at or below 20 percent for years.

And while the protests are led by a relentless opposition movement that probably would have sought Maduro’s ouster even if the economy was stable, their increased size and ferocity this year reveals that they’re inspired by something bigger than perennial partisan rancor. Poor neighborhoods that once brimmed with people fiercely loyal to Chávez have joined anti-government protests in recent months.

Maduro has reacted to the chaos and dissent with authoritarian tactics. In 2016, he blocked an attempt to hold a referendum on whether he should be recalled. In late March, his loyalist-stacked Supreme Court made a ruling that effectively dissolved the opposition-controlled legislative branch and took all of its power for itself, only to reverse the decision days later after the move sparked mass protests.

Maduro has also violently cracked down on protests and imprisoned major political rivals. He’s postponed state elections originally slated for December 2016 several times out of fear that his party will get wiped out at the polls. And in July 2017, he held a rigged election for a legislative superbody that has effectively replaced the opposition-controlled National Assembly.

Chávez preferred to be measured in his strongman maneuvers and used the ballot box to boost his own power, but Maduro has had no qualms about using a much heavier hand. Maduro wants to stay in power, but doesn’t have any way of doing it that involves even pretending to play by the rules of the game.

But Maduro has finally agreed to hold those long-postponed state elections this October, nearly a year after they were originally scheduled. Analysts say that he may have decided to go ahead with them after feeling emboldened by the election of the legislative superbody this summer. Maduro also likely sees them as a way to reduce the high-intensity pressure of protests that garner international attention and prompt foreign countries to slap sanctions on his regime.

“Elections serve as a way of enticing opposition forces to leave the streets and focus on electoral politics,” Pomona College’s Salas said.

If they are indeed held as planned, it will be a major opportunity for the opposition to make inroads among the 23 governorships up for grabs, which are almost entirely dominated by Maduro-aligned politicians.

And that could spark some critical momentum: “The opposition is betting that if they gain in the regional elections, they can reinvigorate their mostly dejected forces and take on Maduro in the presidential elections in 2018,” said Salas.

The big question is how far will Maduro go in trying to ensure that he maintains power in these contests. Recent history suggests that he’s inclined to go pretty far.