The party of leftist Brazilian President Luiz Inacio Lula da Silva has made a strong overall showing in the country's local elections.
Lula, right, saw his party gain in support
His Workers' Party swept to power in six state capitals and nearly doubled the number of municipal councils under its control.
Correspondents say the results reflect growing satisfaction with Lula's handling of the economy.
But the main opposition Social Democrats have also done well.
Voters chose councillors and mayors in more than 5,000 towns and cities altogether.
The Workers' Party (PT) won 389 of them, up from 204 four years earlier, cashing in on Lula's popularity and economic successes.
However, it still has fewer councillors than some of its rivals. The centrist Democratic Movement Party took 1,028 seats, but mostly in rural areas and smaller cities.
Correspondents say the results could be an indication of the president's chances of re-election in 2006.
The PT did well in several major cities and for the first time made inroads in smaller towns away from the main centres of power.
The PT has not done as well as it hoped in Sao Paulo
Justice Minister Marcio Thomaz Bastos said the PT had proved itself competitive in races where some had written it off, and had shown a new maturity.
In cities with more than 200,000 registered voters where no candidate gained more than 50% of the vote, the top two candidates go to a run-off election on 31 October.
PT candidates in several major cities face run-offs, including the country's industrial and financial centre, Sao Paulo, where Social Democrat challenger Jose Serra took more votes than the PT mayor Marta Suplicy.
In Rio de Janeiro, the PT candidate came only fifth.
Mayor Cesar Maia of the conservative Liberal Front Party, who has pledged to end gang violence in the favelas or shanty towns, won in the first round.
He told voters Rio de Janeiro was in the grip of a "civil war", with rival drug-trafficking gangs fighting for control of more than 500 neighbourhoods.
Correspondents reported a carnival mood in many Brazilian cities ahead of the poll.
Candidates have been holding rallies and giving out free t-shirts, baseball caps and leaflets.
Voting is obligatory in Brazil.
Elected with 61% of the vote in 2002, Lula became the country's first president from the
His popularity dropped rapidly as he stuck to an economic austerity programme inherited from his predecessor.
But in recent months the economy has seen some improvement.
Unemployment has fallen while the economy is expected to grow more than 4% in this year, following a 0.2% contraction in 2003.