Brazil's incumbent President Jair Bolsonaro and leftist Lula da Silva are headed to a runoff election after being separated by nearly five percentage points in the first round of elections on Sunday.

Da Silva received 48.1% of the vote while Bolsonaro has 43.5% of the vote with 98.8% of ballots counted.

Polls in the country projected da Silva to potentially cross the 50% vote threshold, which would have handed him the presidency, and Sunday's results were a surprise to many in the country.

Nara Pavão, a teacher of political science at the Federal University of Pernambuco said that the election was closer than the polls indicated. 

BRAZIL'S BOLSONARO LOCKED IN TOUGH RE-ELECTION BID WITH LEFTIST CANDIDATE LULA LEADING IN POLLS

Jair Bolsonaro

President of Brazil Jair Bolsonaro reacts during the exchange of the presidential guard at Planalto Palace on December 16, 2021, in Brasilia, Brazil.  (Andressa Anholete/Getty Images)

"This tight difference between Lula and Bolsonaro wasn’t predicted," Pavão said.

A union leader and former president, da Silva spent 19 months in prison for convictions relating to money laundering and corruption, but the country's supreme court declared the convictions invalid, stating that there was a biased judge and collusion with the prosecutors.

BRAZILIAN JUDGE TEMPORARILY SUSPENDS EASING OF GUN CONTROL LAWS DUE TO ELECTION VIOLENCE FEARS

Lula da Silva

Campaign poster for leftist presidential candidate Lula da Silva in Sao Paulo, Brazil. Photo: David Unsworth for Fox News Digital. (David Unsworth for Fox News Digital)

Bolsonaro, a conservative, was first elected in 2018 and served as president during the COVID-19 pandemic.

People in the Bolsonaro camp believe that the polls were flawed and point to previous elections, stating that the race would be closer than polling suggested.

CLICK HERE TO GET THE FOX NEWS APP 

Brazil President Bolsonaro takes mic at agribusiness event

President of Brazil Jair Bolsonaro speaks during the opening day of Global Agribusiness Forum 2022 on July 25, 2022, in Sao Paulo, Brazil.  (Rodrigo Paiva/Getty Images)

The runoff election between the two candidates will take place on Oct. 30.

Fox News' David Unsworth and the Associated Press contributed to this report.