Brazil’s presidential election is taking place on Sunday in an atmosphere of crisis.

The world’s largest corruption scandal has brought down dozens of politicians and severely damaged public trust in the two parties that have dominated Brazilian politics for decades: the leftist Workers’ Party (PT) and the center-right Brazilian Social Democracy Party (PSDB).

The current president, Michel Temer, is a widely disliked caretaker, appointed after the 2016 impeachment of his predecessor Dilma Rousseff. The one politician with a claim to popularity, former president Luiz Inácio Lula Da Silva, is in jail after being sentenced to 12 years for corruption charges. He was disqualified from running.

Add to that record levels of violence and an economic crisis, and it’s easy to understand the dissatisfaction of the Brazilian electorate, one in five of whom have vowed to spoil their ballots.

Capitalizing on public anger at the political establishment is Jair Bolsonaro, a far-right provocateur who has led the polls for most of the year, but whose candidacy has also inspired mass protests.

As Bolsonaro and left-wing candidate Fernando Haddad top the polls ahead of Sunday’s vote, Latin America’s largest country is on course for “the most polarizing scenario you could come up with,” says Timothy Power, a Chatham House fellow and Professor of Latin American Politics at the University of Oxford. Here’s what to know:

When does voting start?

Nearly 147 million Brazilians will go to the polls on Oct. 7. Voting is mandatory (hence the spoiled ballots) and will take place between 8am and 5pm local time. The results are expected late Sunday.

If no candidate gets an absolute majority – as is highly likely – a second round will take place on Oct. 28.

Who are the main candidates?

Jair Bolsonaro

Bolsonaro, a 63 year-old far-right populist has extended his lead this week, reaching 32%, according to the latest polls. He is the candidate for the tiny Social Liberal Party, which he only joined in January 2018.

The former army captain became a congressman in 1991, six years after the end of Brazil’s 1964-85 dictatorship. The support that he’s expressed for the brutal military regime – which illicitly executed or disappeared at least 434 of its of its own people and tortured at least 1,843 others – have shocked many Brazilians. In an interview with TIME in August, Bolsonaro referred to the executions as “combat” and compared them to the U.S.’ killing of Osama Bin-Laden. He also said Philippine President Rodrigo Duterte, responsible for thousands of extrajudicial executions in his war on drugs, “[has done] the right thing for his country.”

But those kinds of statements have also won him “rock-solid and deep support” among some of the electorate, says Power. As have a series of racist, homophobic and misogynist comments that he has made in public, including telling a congresswoman in 2014, “I wouldn’t rape you because you do not deserve it.”

Bolsonaro is one of the most divisive figures in Brazil. On Sept. 6 he was stabbed in the abdomen at a campaign rally in Juiz de Fora, a town 125 miles north of Rio de Janeiro. On September 30, tens of thousands of Brazilians – mostly women – took to the streets to protest against his candidacy under the banner “Ele Não”, “Not Him”. Power says Bolsonaro’s gender gap is “the highest I’ve seen in any democratic contest,” with some polls showing 17% of female voters backing him compared to 32% of men.

Details of Bolsonaro’s plans for the economy and infrastructure are hazy, says Fernando Schuler, a professor of Political Science at Insper Unviersity in São Paulo. “He’s really mastered the culture wars that have emerged in Brazil,” he says. “He’s come down hard on topics like gun-control, abortion, gender politics and made that the focus of his campaign.” He has made a concerted appeal to evangelical Christians, who make up around 27% of Brazil’s population.

That strategy may sound familiar, but unlike rightwing populists in the U.S., France and Sweden, Bolsonaro’s main support comes from wealthier, more educated Brazilians. Power says that is partly due to Bolsonaro’s hard line on law and order amid a surge of violent crime in Brazil.

Fernando Haddad

The candidate for the PT was a late entry to the race, only being confirmed as the party’s candidate after Brazil’s electoral court disqualified Lula in August. “His main challenge is getting out from under Lula’s shadow,” Power says, adding that critics portray Haddad as Lula’s puppet and warn that, if elected, he would use executive powers to release him from prison. Last week Haddad was forced to dismiss this claim from a member of his own party.

A lawyer and economist, he was Mayor of São Paulo until 2017. He saw a surge in support after entering the race, but seems to have plateaued around 21%. Haddad, 55, has previously spoken out against irresponsible public spending by his left-leaning party. But he has now pledged to reverse austerity policies implemented by the ruling center-right government. “We are not going to sacrifice the people any more,” he told the Guardian after launching his campaign. “Without public investment, without families spending, without cheap credit, the economy won’t recover.”

Ciro Gomes

The candidate for the Democratic Labor Party, Gomes is the main centre-left alternative to Haddad. He is polling at 11%. Gomes, 60, has been in politics for four decades and has remained largely scandal-free. He has served as a governor, a finance minister and a congressman and has already run for president twice before. Having worked in Lula’s government and supported him in the past, Gomes was expected to gain some of the jailed former president’s support. Yet so far, voters have mostly gone to Haddad. He has been harshly critical of both Bolsonaro, whom he calls a fascist, and the PT, for allowing Bolsonaro’s rise by announcing their candidate so late.

Gerardo Alckmin

Alckmin, 65, is the candidate for the ruling centre-right PSDB and is currently on 9%. The São Paulo state governor has been called “the Brazilian Hillary Clinton” because of his failure to win over voters despite ample experience in government. “He’s an establishment candidate in an anti-establishment moment,” Power says. “He’s a very bland middle-of-the-road figure.” Alckmin had been counting on taking the votes of the large proportion of Brazilians that say they would never vote for the PT — but has been battered by Bolsonaro’s rise.

Marina Silva

The founder of Brazil’s Green Party and former environment minister, Silva, 60, is running on a platform of promoting sustainability while creating jobs. She also wants to invest more in education and roll out high-speed internet access across the country. She is currently polling at 4%.

What are the issues on voters’ minds?

Schuler says that “culture wars,” rather than policy discussions, have dominated the 2018 elections. But there are at least three other key points at stake:

Corruption

The Lava Jato (Car Wash) corruption probe launched in 2014 to investigate billions of dollars in graft at state-owned owned firm Petrobras. Dozens of politicians have been investigated for things like taking kickbacks to award public contracts to companies that later overcharged the state. At one point last year a third of the cabinet was under investigation. Public anger at the political class has upended the two-party system that has dominated Brazil since the 1990’s. 7 in 10 Brazilians say they have no trust in any political party. “There’s a feeling that there’s something rotten in Brasília,” says Power. “Many people just want to get all the bums out.”

Security

2017 was the most violent year in Brazil’s modern history, with 63,880 murders. Economic troubles driving people towards crime and the drug trade is partly to blame, says Power, and reduced public spending on security forces has also contributed. Bolsonaro claims the surge in violence is the fault of human rights activists and global human rights treaties, which restrict Brazil’s ability to fight crime. He has pledged to give police more discretion to use lethal force and to lift gun control laws to allow Brazilians to defend themselves. “If someone breaks into our house or our ranch we must have the right to shoot them – and if we kill them, it’s their problem for dying, not ours,” he said at a campaign rally earlier this year.

Economy

Brazil is emerging from a four year-long recession, which has driven unemployment up and wages down. The budget is balanced for now, but economists are warning that spiralling public debt could spark a new financial crisis soon. Though Haddad is a moderate, investors are hostile to his party’s plans to ease budget restrictions and their refusal to overhaul the expensive public pension system. Despite his reactionary views, Bolsonaro is seen as more market-friendly; after polls revealed he had extended his lead over Haddad this week, the local currency, the real, jumped to its highest rate against the dollar in months.

Who will win in a run-off vote?

Polls agree that any run-off vote will almost certainly be between Bolsonaro and Haddad, the most ideologically-opposed candidates in the race. Then, the question will be how many of the smaller parties’ supporters will drift to the far-right candidate — and how many right-of-center voters will hold their noses and vote for Haddad to keep Bolsonaro out. It’s certainly possible the former Army general will take the presidency; one simulated second-round poll shows Bolsonaro beating Haddad 44% to 42%, with the rest of voters spoiling their ballots.

A lot will depend on who the eliminated candidates choose to endorse and how the rest of Brazil’s politicians respond. Bitter partisan divisions mean it’s unlikely that parties will band together to block Bolsonaro out, says Power. “There’s a good portion of congress that’s very opportunistic,” he says, “Before they make a move, they’ll wet their finger and hold it in the air to see which way the wind is blowing.”

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Ciara Nugent at ciara.nugent@time.com.