The United States said Thursday that Brazilians needed "confidence" in their democracy after President Jair Bolsonaro cast doubt on the integrity of upcoming elections.

The far-right incumbent was one of former US president Donald Trump's closest allies and has taken a page from his playbook, alleging without evidence that there is rampant fraud in Brazil's electronic voting system.

State Department spokesman Ned Price said the United States has "high confidence in Brazil's democratic institutions."

"Brazil has a strong track record of free and fair elections with transparency and high levels of voter participation," Price told reporters.

"It's important that Brazilians, as they look forward to their elections later this year, have confidence in their electoral systems and that Brazil once again is in a position to demonstrate to the world through these elections the enduring strength of Brazil's democracy," he said.

Brazilian President Jair Bolsonaro, seen in Brasilia in September 2021, has faced criticism from US Democrats over his comments on democracy
Brazilian President Jair Bolsonaro, seen in Brasilia in September 2021, has faced criticism from US Democrats over his comments on democracy AFP / EVARISTO SA

Bolsonaro is trailing in polls ahead of the October elections to former president Luiz Inacio Lula da Silva, a popular leftist who was jailed in a controversial corruption case.

On Thursday, Bolsonaro announced his party would hire a company to audit the elections, a new sign of his campaign's distrust for electronic voting, which he has spent years discrediting.

Bolsonaro has frequently questioned the voting system and deployed campaign catchphrases saying that he sees "prison, death or victory" as the only possible results of the poll.

Bolsonaro enjoys a large social media following and his supporters have spoken with admiration about the January 6, 2021 attack on the US Capitol, raising fears for the conduct of the election in the Western Hemisphere's second most populous nation.

US President Joe Biden has avoided public flare-ups with Bolsonaro and has sought cooperation where possible, including on climate policy -- a crucial issue for Brazil.

Bolsonaro has publicly acknowledged a quiet visit last year by CIA chief William Burns, who has often served to send sensitive messages from the Biden administration to foreign governments.