Workers' Party candidate and former education minister Fernando Haddad won more than 55 percent of the vote in Sao Paulo, a traditional stronghold for the top opposition party.
Haddad began the race months ago polling just 2 percent. But he eased into office on the back of strong campaigning from popular former President Luiz Inacio Lula da Silva and Brazil's current leader Dilma Rousseff.
Haddad served as education minister from 2005 until 2012 under both Silva and Rousseff.
Following his win, Haddad said he would break through the "wall of shame that separates the rich city from the poor city." He promised to make advances in education and the woeful public transportation system poor.
Jose Serra, of the Brazilian Social Democracy Party and a former mayor and governor of Sao Paulo, won 44 percent of the vote. He ran against Rousseff in the presidential race in 2010 and against Silva for the presidency in 2002.
Brazilians cast their votes in the second round of municipal elections Sunday to decide who would lead in 50 big cities.
The Brazilian electoral system requires candidates to win with a majority. Sunday's election resolved races where top finishers fell short of half on Oct. 7.