His inauguration will be on January 1, 2019.
Bolsonaro said immediately after his victory was announced on Sunday night he would try to "pacify" Brazil after a heated election campaign.
Bolsonaro was stabbed in the stomach last month during a rally in the city of Juiz de Fora, in Minas Gerais state.
People on their way to vote at a polling station of Rocinha, a shantytown in Rio de Janeiro.More news: Unrepentant Ty Montgomery hits back at anonymous teammates who blasted him
Bolsonaro voted in a military district in Rio de Janeiro, greeted by supporters shouting "legend" and "president".
Bolsonaro's win alarmed critics around the globe, mainly because of his vows to sweep away leftist political opponents and his history of making insulting comments about gays, women and minorities.
He once told a congresswoman that she did not deserve to be raped because she was "very ugly", Brazil's TV Globo reported.
The polls came on the heels of Brazil's worst-ever recession, a staggering multi-billion-dollar corruption scandal and a year of record-setting violent crime.
The left-winger had promised to bring back the boom years Brazil experienced under left-winger Lula da Silva, who led initial polls by a wide margin but was banned from running in the election due to a corruption conviction.
Lula remains the country's most popular politician, despite being accused of masterminding the massive pilfering of state oil company Petrobras.
"It is in the respect of these values that France wishes to continue its co-operation with Brazil in tackling major issues of the day, as well as areas such as peace, worldwide security and environment issues within the context of the Paris Climate Agreement", said a statement from President Emmanuel Macron's office.More news: In pics: PM Modi meets Shinzo Abe in Japan
An outspoken admirer of U.S. President Donald Trump, Bolsonaro also pledged to realign Brazil with more advanced economies, overhauling diplomatic priorities after almost a decade and a half of leftist rule.
"We're electing our captain".
Feelings on the other side were equally strong.
"He incites hatred. If he becomes president, he'll legitimize all that hatred inside people".
The spokesperson for French President Emmanuel Macron's centrist party in parliament, Aurore Berge, meanwhile, tweeted a warning over the Brazilian election results that "no democracy is safe". Several key endorsements late Saturday gave Haddad's camp hope that they could still pull out a victory.
In Sao Paulo, the economic capital, Marcos Kotait, 40, a publicist, said he had "never seen such a polarized election".
But "we shouldn't lose sight of the fact that Brazil has one of the most solid democracies in Latin America", said Leandro Gabiati, head of Brasilia-based consultancy Dominium.More news: This is the all new iPad Pro 12.9 for 2018
"By preventing former president Lula da Silva, Brazil's most popular politician, from running in this election, the country's right-wing elites subverted democracy and paved the way for a unsafe fascist to take power", Weisbrot said. In 2016, then-President Dilma Rousseff of the Workers' Party was impeached and removed from office on charges that many on the left felt were politically motivated.