The extent to which the 63-year-old had captured the electorate across Brazil was soon clear. He won 16 of Brazil’s 26 states and achieved nearly 60 percent of the vote in Rio de Janeiro and the federal district, Brasília.

His total first-round count of 46 percent saw him outperform polls but fall just short of an outright victory. Instead, he will now face Fernando Haddad, the leftist stand-in for jailed ex-President Luiz Inácio “Lula” da Silva, in a run-off on Oct. 28. Haddad fell far behind in the first round, with 29 percent of the vote.

The result has left Bolsonaro, a former army captain, on the verge of power. The foremost defender of Brazil’s 1964-1985 dictatorship began his ascent in the midst of the country’s worst-ever recession and a graft scandal that enveloped nearly all the political class, pitching himself as an outsider against rampant corruption, crime and the media.

The Brief Newsletter

Sign up to receive the top stories you need to know right now. View Sample

He has since repudiated comments he made in the 1990s after being elected to Congress, calling for the return of military rule and a “civil war” that would kill “about 30,000” but still speaks fondly of the dictatorships in Brazil and Chile that killed and tortured thousands.

Bolsonaro’s initial notoriety was based on verbal tirades against women, ethnic minorities, gays and leftists. Many of his policies on trade, the environment and deregulation come from the playbook of U.S. President Donald Trump, whom he sees as a role model. “Let’s make Brazil great! Let’s be proud of our homeland once again!” he said on the eve of the vote.

Like Trump, he has pledged to withdraw his country from the Paris Agreement on climate change. He plans to loosen gun control laws and give already trigger-happy police further impunity to kill.

“There is a risk to democracy,” says José Alvaro Moisés, a political scientist at the University of São Paulo, who cited how Bolsonaro had previously said the work of “eliminating” those who had opposed the military dictatorship had not yet been concluded.

“He has an authoritarian stance that is very dangerous,” he says. “But it doesn’t mean that if he wins, he will start off implementing these authoritarian measures.” Congress and the Army would likely stand in the way of more extremist policies, he adds.

When TIME interviewed him in June, Bolsonaro was polling at 15 percent, with negligible support among women, the poor and minorities. Since then, former president Lula – who was leading the polls – was excluded from the race after a corruption conviction. And Bolsonaro’s social-media powered campaign kept gaining momentum against better-funded opponents, accelerating after the candidate was stabbed and seriously injured at a campaign rally on Sept. 6.

In the final week of the campaign Bolsonaro’s support expanded from an initial base of rich, educated, white, older men to include many more young people and poorer voters, according to Rosana Pinheiro-Machado, an anthropology professor at the Federal University of Santa Maria who studies his supporters. In some cases, she says, churches were encouraging worshippers to vote for him.

A third to a half of Bolsonaro voters are deeply passionate about him, she says. “They are his fans, they love him, they cry over him, they will go to meet him at airports. This runs through all social classes. It’s an electoral phenomenon.”

All the analysts spoken to by TIME said Haddad would have a difficult task converting voters who had already chosen Bolsonaro. “They will need to persuade some of his voters to switch sides,” says Maurício Santoro, a political science professor at the Rio de Janeiro State University. “But there is such widespread rejection of the Workers’ Party.”

That party has won the last four presidential elections but became indelibly linked the corruption scandal, known as Operation Car Wash. Prosecutors alleged Brazil’s government was run like a cartel for years, with billions of dollars stolen from public coffers.

One former president, Lula, is serving a 12-year sentence for corruption. Another, Dilma Rousseff, was impeached in 2016 and last night failed to win a senate seat in her home state. Lula says his conviction is an abuse of process intended to prevent his return to office.

“It is important for the establishment to hear this message,” Santoro adds. “Many voters blame the economic crisis on corruption. The narrative is the politicians stole all the money.”

If elected on Oct.28, Bolsonaro will deal with a Congress that has shifted further rightwards in these elections. His once tiny Social Liberal Party, which only elected one deputy out of 513 four years ago, now has 52 — making it the second largest party in the chamber. “We are seeing a conservative wave with an underlying desire for the renewal of politics,” Moisés says.

Despite long being a peripheral figure who has authored only two laws in his 27 years in Congress, Bolsonaro now has the makings of a powerful coalition, including agribusiness, evangelical churches and financial institutions who are reassured with his commitment to appoint a finance minister who is in favor of liberalizing markets and privatization.

“Congress will be more conservative with an extreme-right contingent that we have never had before,” says Sylvio Costa, the founder of the Congress in Focus watchdog. “Whether he wins the election or not, he has already won. Politically speaking, he is already much stronger.”

In the interview with TIME, Bolsonaro said he has shed his anti-democratic views. Indeed, he said, the real threat to democracy comes from the left turning Brazil into Venezuela.