Nunes, who received lukewarm support from former President Jair Bolsonaro in the campaign, distanced himself from the far-right leader in his victory speech.
Nunes, who inherited the mayorship after Bruno Covas died of cancer in 2021, had almost 60% of the vote to secure another four years on the job, election officials said. He topped lawmaker Guilherme Boulos in the runoff which followed a first round of voting on Oct. 7.
The reelected mayor did not mention Bolsonaro as one of the people who helped him win and championed Sao Paulo Gov. Tarcisio de Freitas, an ally of the far-right leader. The former president's conservative base was split in Sao Paulo by Nunes and Pablo Marçal, who narrowly lost a place in Sunday's runoff.
Nunes thanked "the biggest leader, without whom we could not have had this victory, and that's governor Tarcisio de Freitas."
Carlos Melo, a political science professor at Insper University in Sao Paulo, said both Lula and Bolsonaro suffered defeats in the various mayoral elections held in Brazil.
"Neither have a positive tally in these elections. Bolsonaro was hidden in several places. Wherever he appeared too much, he lost," Melo told The Associated Press.
"Lula lost the myth that he can transfer votes," he added. "It isn't that simple, these are different times. His administration might do relatively well in the economy, but it doesn't thrill anyone so far. The president had a big bet in Sao Paulo, in the city of Natal, and did not win."
Earlier, Gov. de Freitas added another chapter to the metropolis' troubled election. He claimed during a press conference, without providing evidence, that police had detected an endorsement of Boulos by criminal organization PCC.
Boulos, who frequently accused Nunes of harboring members of the criminal group in his administration, said in a press conference the governor should be arrested for his comments during the vote.
The leftist candidate said he was not going to deliver "a loser's speech" after Nunes' victory.
"We lost an election, but in this campaign we recovered the dignity of Brazil's left," Boulos said. The federal lawmaker will be under pressure to leave his Socialism and Liberty Party for Lula's Workers' Party after the election.
Most of the attention in this year's municipal elections in Brazil has been on Sao Paulo, where the first round of voting was marred by episodes of violence. Boulos, a longtime housing advocate for the poor, had his second consecutive defeat in the race.
Other Brazilian cities with more than 200,000 registered voters were also holding mayoral elections.
In Rio de Janeiro, incumbent Mayor Eduardo Paes was reelected in the first round for his fourth, non-consecutive term. Paes, an enthusiastic fan of Carnival, had Lula's support but focused his campaign on local issues against Bolsonaro's candidate, Alexandre Ramagem.
Brazilians were also watching closely for results in Belo Horizonte, one of the country's biggest cities, where Mayor Fuad Noman beat pro-Bolsonaro candidate Bruno Engler.
The vote in Fortaleza, another of the nation's biggest cities, was a dead heat between the candidate from Lula's Workers' Party, Evandro Leitão, and pro-Bolsonaro challenger André Fernandes. Leitão won by less than 1%.