In Sao Paulo, the city with the most voters in the country, the current mayor, Bruno Covas, of the Brazilian Social Democracy Party (PSDB), took the lead with nearly a third of the votes, 32.8 percent.
However, Covas will have to face the leftist and former presidential candidate Guilherme Boulos in the second round on November 29, when he finished second with 20.2 percent.
The Bolsonaro-backed candidate, conservative Celso Russomanno finished in fourth place with just over 10 percent of the vote.
In Rio de Janeiro, Brazil's second-largest city, center-right Eduardo Paes finished first, with almost 40 percent of the votes. He will face the current mayor, ultra-conservative and evangelical leader Marcelo Crivella, in a second runoff election.
Crivella, who is backed by Bolsonaro, got only 21.9 percent of the city's votes.
So Brazil's President Jair Bolsonaro is homophobing again ��
He must really hate the fact that around the time of his election, far from hiding, 3 million of Brazil's 'queers' turned the streets of Sao Paolo into the largest pride parade in history. Never forget. ��️����❤️����❤️���� pic.twitter.com/tFBHc7yMJS
The results in Belo Horizonte, the third-largest city in terms of voters, current mayor Alexandre Kalil, got over 50 percent of the votes, leaving Bolsonaro's candidate Bruno Engler out of the race.
In a second round, Recife will decide between Joao Campos, of the Brazilian Socialist Party (PSB), and his cousin Marilia Arraes, representative of the Workers' Party (PT).
Police chief Patricia Domingos, supported by Bolsonaro, finished in fourth place, with less than 15 percent of the ballots.
After the first election results were announced, Bolsonaro eliminated from his social networks a post from previous days in which he asked his supporters to vote for various candidates in the country's cities, including Crivella and Russomano.
In Rio de Janeiro, Monica Benicio, widow of the murdered councilwoman of the Socialism and Liberty Party (PSOL) and human rights defender Marielle Franco, was elected councilwoman in the municipal elections.