President Dilma Rousseff has promised to re-unite Brazil after narrowly winning re-election to a second term in office with 51.6% of the vote.
She said "dialogue" would be her top priority after a bitterly fought campaign against centre-right candidate Aecio Neves, who got 48.4% of the vote.
The left-wing leader said she wanted to be "a much better president than I have been until now".
She faced mass protests last year against corruption and poor services.
But Ms Rousseff, who has been in power since 2010, remains popular with poor Brazilians thanks to her government's welfare programmes.
The vote split Latin America's biggest country almost evenly in two, along lines of social class and geography.
Whereas Dilma Rousseff did well in the poorer northern states, her opponent from the Brazilian Social Democracy Party (PSDB) took many of the wealthier and more developed southern parts of Brazil.
The president said that during the campaign "the word repeated most often was change and the idea most often invoked was reform".
Analysis: Wyre Davies, BBC News, Rio de Janeiro
The president's appeal for unity and dialogue was an important recognition that, despite 12 years of tangible social benefits under Workers' Party (PT) rule, millions of Brazilians are less than satisfied.
The standards of public services across the country in health, education and basic sanitation are too low for a country that prides itself on having the seventh largest economy in the world.
This government deserves credit for helping to bring millions of people out of poverty but, as a result, public expectations here are now much higher.
By the time Dilma leaves office in 2018, the Workers' Party will have been in power for 16 years.
That may prove too much for some to bear but it is undeniable that life for most Brazilians has improved immeasurably during the PT's mandate thus far.
"Sometimes in history, close outcomes trigger results more quickly than ample victories," she said.
"It is my hope, or even better, my certainty that the clash of ideas can create room for consensus, and my first words are going to be a call for peace and unity," she told a cheering crowd in the capital, Brasilia.
"Instead of widening differences and creating a rift, I have the strong hope that we can use this energy to build bridges."
She also thanked her supporters, especially her political mentor and predecessor in office, Luiz Inacio Lula da Silva.
"I thank from the bottom of my heart our number one militant, President Lula."
Her Workers' Party (PT), which has been in power since 2002, will now govern for another four-year term starting on 1 January 2015, but with a considerably weaker mandate than before.
Analysis: Katy Watson, South America Business reporter
Poorer Brazilians voted in Dilma Rousseff for a second term because of her party's track record in lifting millions out of poverty.
But the business community is more worried about the future. The election race was full of twists and turns - all closely followed by the financial markets.
On Monday, the benchmark Bovespa index plunged more than 5%; all of its gains this year have been wiped out.
Ms Rousseff needs to persuade the business community that she is serious about tackling Brazil's economic woes. Key to this will be who she names as her new finance minister and what policies her government will adopt.
Will it be more of the same interventionist policies that businesses say stifle confidence and trade? Or will she, as promised, focus on reforms, to win back investor and consumer confidence and get Brazil growing once again?
Her lead over the Brazilian Social Democracy Party dropped from 12 percentage points in 2010 to three in Sunday's election.
The divided nature of the vote was palpable in Sao Paulo, where disappointed supporters of Mr Neves chanted "Kick the PT out!" while PT voters waved flags and celebrated in the streets.
Mr Neves admitted defeat and thanked the "more than 50 million Brazilians who voted for the path to change".
He said that the "overriding priority is to unite Brazil around an honourable programme worthy of all Brazilians".
Ms Rousseff promised wide-spread reform and a "rigorous fight against corruption", one of the grievances which led to mass protests last year.
She said she would "strengthen control mechanism and propose changes to the legislation to put an end to impunity".
Both Ms Rousseff and Mr Neves had made economic growth central to their election campaigns and the president again referred to her plans in her victory speech.
She said she would "continue to fight inflation and make improvements in the field of fiscal responsibility".
With Brazil's once booming economy now stagnant and inflation on the rise, analysts say her main challenges will be to regain the confidence of investors as well as that of those Brazilians who voted for Mr Neves.