In its first electoral test since taking power 21 months ago, the party of President Luiz Inacio Lula da Silva emerged stronger from nationwide municipal elections but did not win in the country's biggest city, Sao Paulo.
With more than 90 percent of the ballots counted from Sunday's voting, the Workers' Party had won the mayoral race in 322 municipalities, up from 204 four years earlier, the Supreme Electoral Court said.
The victories included six out of 26 state capitals, and Lula's party has a chance of winning in another nine state capitals in a runoff election on Oct. 31.
In Sao Paulo, Brazil's biggest city and industrial engine with 10 million people, Lula's party came in second place and will have to compete in the runoff vote.
With 98 percent of the vote in Sao Paulo counted, former health minister Jose Serra of the opposition Social Democratic Party led with 43.6 percent, while incumbent Mayor Marta Suplicy, 59, a Stanford University-educated psychologist, trailed with 35.8 percent, making a runoff election certain.
In Rio de Janeiro, the second-biggest city, Mayor Cesar Maia of the opposition Liberal Front Party won reelection in the first round.
While most voters were motivated by local issues, political analysts say the election's outcome could have a major impact on the general elections in two years. "Lula has broadened his power base," said David Fleischer, a political scientist from the University of Brasilia.
Lula, a former metalworkers' union leader, won the presidential election in a landslide two years ago, promising social and economic justice for Brazilians. In July, thousands of Brazilians took to the streets across the country to protest high unemployment and interest rates. Protests have ebbed since then and Lula recently has been doing better in opinion polls.