Brazilian President Luiz Inacio Lula da Silva has retained his lead over right-wing Senator Flavio Bolsonaro ahead of October’s election, according to a new poll.

A Quaest survey published on Friday found Lula would take 43 percent of the vote in a simulated run-off, against 40 percent for Bolsonaro, effectively a statistical tie given the poll’s two-point margin of error.

The result marks a narrowing from an earlier Quaest poll on August 5, which had put Lula ahead by a wider five-point margin, 44 percent to 39 percent.

In a first-round scenario, Lula leads more comfortably with 38 percent, followed by Bolsonaro at 31 percent. Three other candidates trail far behind: Renan Santos and Ronaldo Caiado each polled at 4 percent, and Romeu Zema at 2 percent.

Under Brazilian electoral rules, if no candidate secures more than half the valid votes in the first round, the top two finishers advance to a run-off.

Flavio Bolsonaro, the eldest son of former President Jair Bolsonaro, has emerged as the standard-bearer for Brazil’s right after his father was barred from running in the election.

The elder Bolsonaro was ruled ineligible for office after Brazil’s top electoral court found he had abused his power while in office. He was later convicted separately over a plot to overturn his 2022 election loss to Lula.

The poll, conducted by Quaest between August 10 and 13, surveyed 2,004 people and was commissioned by the Brazilian media group Globo.

Lula launched his re-election bid on August 2 at the Workers’ Party convention in Sao Paulo, casting himself as a defender of Brazilian “sovereignty” as pressure from the administration of United States President Donald Trump looms over the race.

He called for increased defence spending and pledged to shield Brazil’s reserves of rare earths and other critical minerals from foreign control. “I want to be prepared, so that no one invades this country,” he said.

He warned that China, the US and France would not get access to Brazil’s mineral wealth without respecting the country’s sovereignty. He also told the convention: “In Brazil, we do not accept anyone sticking their nose where it does not belong.”

Trump has maintained close ties with the Bolsonaros. In June, Lula warned Trump not to interfere in the presidential race.

“Don’t meddle in the Brazilian elections, because the Brazilian elections are a Brazilian problem, just as American elections are their business, not mine,” Lula said.

With the race tightening two months out from the vote, the results so far have shown a competitive presidential race, even as Lula continues to hold a narrow structural advantage heading into the final stretch of the campaign.