In the era of Donald Trump, domestic matters have taken center stage even more than usual for most Americans, and the rest of the world has mostly fallen off the wings. As a case in point, over the past week or so, while the country has been transfixed by the drama of Brett Kavanaugh’s Supreme Court confirmation, America’s largest neighbor to the south, Brazil, has been lurching toward far-right authoritarianism. On Sunday, Brazil’s voters will elect a new President, and the man leading in the polls, a former Army captain named Jair Bolsonaro, is something like a Brazilian version of Donald Trump—slimmer and a decade younger, but just as mouthy—with a large dollop of the Philippines’ President Rodrigo Duterte thrown in.

Bolsonaro’s rise has had a disquieting, inexorable quality to it, recalling Trump’s path to victory. As with Trump, it is Bolsonaro’s status as an outsider and a roguish prankster that has brought him into favor. Both men also share an instinct for waiting for the political Zeitgeist to provide them with an opening. Bolsonaro’s arrived during a serious economic decline and a national loss of faith in the mainstream political parties, as well as in governmental institutions.

Since September 6th, Bolsonaro has been recovering from a near-fatal stabbing attack at a campaign appearance, and his numbers have risen steadily in the field of thirteen candidates. Ten days ago, he was at twenty-seven per cent, six points ahead of his nearest challenger, Fernando Haddad, a former mayor of São Paulo, who represents the left-of-center Workers Party, or P.T., and pundits predicted a tight race between the two in a runoff vote scheduled for October 28th. But, in the past few days, Bolsonaro has catapulted ahead; he is now polling at thirty-five per cent, with Haddad lagging at twenty-two, and there is increasing speculation that Bolsonaro may win outright in the first round.

If Bolsonaro does win, a political sea change will have occurred in Brazil. The P.T. was in office from 2003 to 2016, but its hold on power, and on Brazilians’ sympathies, collapsed amid the country’s devastating recession and a slew of corruption scandals. Haddad entered the race just last month, after a court ruled out the candidacy of Luiz Inácio Lula da Silva, the Party’s charismatic veteran leader and a two-term former President, who has been in prison since April, on corruption charges. (In 2016, Lula’s successor, Dilma Rousseff, was impeached; since then, Brazil has been run by an unpopular caretaker President, Michel Temer.) Lula had been the front-runner; Haddad, who lost his bid for reëlection as São Paulo’s mayor in 2016, has been unable to gain traction against Bolsonaro.

Most of Bolsonaro’s supporters get their news from social media, such as Facebook and WhatsApp, and the candidate has learned how to use it to his advantage, much as Trump has with Twitter. He now has nearly seven million Facebook followers—he has apparently gained a million in the past three weeks—far more than any of the other candidates. In scheduled debates, he has gone one better than Trump, who mostly just insulted his rivals, by not showing up at all. This, too, seems to have helped him. Since the most recent debate, on Thursday, which he did not attend, he has gained two percentage points.

In another echo of Trump, Bolsonaro has been bolstered by a wave of support from the private sector and evangelicals. This past week, the billionaire televangelist Edir Macedo, who has a huge following in Brazil, and a media empire, announced his support. Brazil’s businessmen, in their swing to Bolsonaro, seem simply to have done their math. Their center-right candidates are languishing far behind in the race, and Bolsonaro’s promise to hand economic policy over to a well-known University of Chicago-educated economist named Paulo Guedes has made him a more palatable choice for them. Perhaps most surprising, however, Bolsonaro’s support has been growing among middle- and upper-class women, even though he opposes equal pay for women (“because they get pregnant”), paid maternity leave, and abortion. There’s also the fact that he was found guilty on charges of incitement to rape and defamation, after he told a congresswoman that she “wasn’t worth raping” (he said it twice, the first time in 2003), and was ordered to pay her damages of about twenty-five hundred dollars. In a related case, the attorney general recently charged him with inciting hatred and discrimination against women and other groups. (Bolsonaro denies the charges, saying that they are politically motivated; the initial incident with the congresswoman was caught on video.) This past Saturday saw nationwide protests led by women—members of the “Not Him” movement—but Daniela Pinheiro, the editor of the weekly news magazine Epoca, told me that “Brazilian TV didn’t cover the protests well, and the day after, Bolsonaro’s people spread a lot of fake news, including pictures of naked women peeing in the streets, saying, ‘This is what the P.T. wants to do with our women and kids.’ ”

Bolsonaro and Trump may be uncannily similar in their world view and comportment, but they have led different lives. A lanky, floppy-haired sixty-three-year-old of Italian-immigrant stock, Bolsonaro went into Brazil’s Army academy from high school, in 1971, at the height of the country’s repressive right-wing military dictatorship, and served in the Army for seventeen years, leaving with a captain’s rank and a reputation for being “ambitious” and “aggressive.” He has remained both. After a stint as a city councilman, in Rio, he was elected to Congress in 1991, and has held his seat ever since. Although he has spent most of that time on the political sidelines, he has been unswerving in his role as a provocateur, prone to outrageous statements that insured headlines. These have included inflammatory pronouncements about his own children. Bolsonaro, who has been married three times, is the father of four boys and a girl. He once told a crowd that his daughter was sired “in a moment of weakness,” and he has said that if any one of his sons turned out to be gay, “it would be better for him to die in an accident.”

Bolsonaro is a routine hurler of insults, prone to branding people, among other things, as vagabundos, akin to Trump’s “losers.” He has called immigrants from Haiti, Africa, and the Middle East “the scum of humanity,” echoing Trump’s comments about “shithole” countries. Also like Trump, Bolsonaro is an ardent foe of environmentalism, promising to eliminate Brazil’s environment ministry and to discard wilderness and indigenous-rights protections, in favor of more economic development, especially for mining interests. He has sworn to withdraw Brazil from the Paris climate accord.

Bolsonaro also shares Trump’s affinity for autocrats, and he has a fanboy fixation on men in uniform—his Vice-Presidential pick, Antônio Hamilton Mourão, is a retired general. While Trump has gushed over Duterte, Vladimir Putin, and Kim Jong Un, Bolsonaro has expressed admiration for Augusto Pinochet, the late Chilean dictator, Alberto Fujimori, Peru’s disgraced former autocrat—and Trump. (Trump is bound to reciprocate the sentiment if Bolsonaro makes it into office.)

Most distressing of all, Bolsonaro frequently praises the country’s former military dictatorship, which ruled from 1964 to 1985, and has called for its restoration. He has said that, if anything, the dictatorship had been too soft, noting that its “error was that it tortured but didn’t kill.” (In fact, the dictatorship killed hundreds of people, including leftist trade unionists, students, professors, and also a small number of guerrillas.) Bolsonaro has described torture as a legitimate practice, going so far as to offer his vote in the impeachment proceedings against Rousseff in honor of one of the dictatorship’s most notorious torturers.

Indeed, Bolsonaro’s policies would likely result in the killing of more Brazilians. He advocates relaxing gun-ownership laws, and has said that, as President, he would work to restore the death penalty, which was abolished in 1889, when Brazil became a republic. In some speeches, he has made Duterte-like statements, seeming to endorse the summary execution of criminals by the police. In a country where violence and public insecurity are at an all-time high—there were nearly sixty-four thousand homicides last year, giving Brazil one of the highest murder rates in the world—such Dirty Harry sentiments are popular. Bolsonaro’s trademark is a trigger-pulling gesture; some of his followers wear shirts emblazoned with his name and the silhouette of an automatic rifle.

Earlier this week, another Brazilian friend, the journalist Consuelo Dieguez, trying to explain the Bolsonaro phenomenon, told me that, “because of Brazil’s problems with the economy and security, there are many people who say that the country needs ‘a strong man’ to set the country in order. And so they are prepared to support Bolsonaro, even though he is not a democratic person but someone who defends torture and the dictatorship.” She added, “But they see that the military supports him, and so a portion of the population believes they will solve all of Brazil’s problems together.” Dieguez believes that, because of this logic, “Brazil will end up with an authoritarian government,” and because “Bolsonaro is completely unprepared for the Presidency,” the military will play a big role.

On Thursday evening, after the Presidential debate, Dieguez wrote me again. “If Bolsonaro wins in the first round,” she said, “he won’t need to make any concessions with the other political parties. He will be very powerful.”

Pinheiro agrees. “Keep in mind, it’s completely different here than in the U.S., where you have strong institutions and the rule of law,” she said. “That, at least, can make it harder for Trump. We don’t have that here. And, for the first time since the return to democracy, none of us really has a clue what is going to happen tomorrow. I am terrified.”