Brazil's far-right President Jair Bolsonaro has used his inaugural speech to promise to build a "society without discrimination or division".
The former army captain told Congress he wanted a "national pact" to free Brazil of corruption, crime and economic mismanagement.
In a swipe at the left, he vowed to free Brazil of "ideology".
He is seen as a deeply divisive figure whose racist, homophobic and misogynistic remarks have angered many.
Mr Bolsonaro, 63, won the presidential election by a wide margin against Fernando Haddad of the left-wing Workers' Party on 28 October.
He was propelled to victory by campaign promises to curb Brazil's rampant corruption and crime.
US President Donald Trump commended him for his speech on Tuesday, saying the US was "with" him.
Among the foreign guests at the inauguration were US Secretary of State Mike Pompeo, Israeli Prime Minister Benjamin Netanyahu, Hungarian Prime Minister Viktor Orban and Portuguese President Marcelo Rebelo de Sousa.
'Bromance with Trump'
Analysis by Katy Watson, BBC News, Brasilia
Jair Bolsonaro may have struck a more presidential tone in today's speeches compared with the fiery rhetoric used during his campaign, but he made it clear his values remained the same – family, conservatism and God.
And despite having won the elections, he's not given up his criticism of Brazil's leftist politics that he feels have ruined the country. The rhetoric he used was familiar – that from today Brazilians are now freed from socialism – and it strikes a chord with millions fed up with corruption scandals that have embroiled Brazilian politics in recent years.
With Donald Trump and the so-called "Trump of the Tropics" exchanging tweets about their mutual support for each other and commitment to work together, the bromance with one of the world's most powerful presidents has begun. It's a relationship that everyone will be watching very closely.
What exactly did Bolsonaro promise?
"Brazil will return to being a country free of ideological constrictions," he told Congress in the capital, Brasilia.
"I will divide power in a progressive, conscientious and responsible way."
His administration, he said, was "committed to those Brazilians who want good schools to prepare their kids for the job market and not for political militancy".
Pledging support for the military and police, he said: "The national motto is order and progress. No society can develop without respecting these."
On the economy, he promised to "create a new virtuous cycle to open markets" and "carry out important structural reforms" to tackle the public deficit.
In an apparent reference to gun control, he said: "Good citizens deserve the means to defend themselves." On Saturday, he tweeted that he would issue a decree to allow citizens who did not have a criminal record to own guns.
After being sworn in in front of Congress, Mr Bolsonaro went on to the Planalto Palace where the outgoing President, Michel Temer, handed over the presidential sash.
Speaking afterwards, he said Brazil would "start to free itself of socialism" and "political correctness".
On a day filled with pageant, he travelled around Brasilia in an open-top vintage Rolls Royce escorted by cavalry on white horses and jogging security guards, as crowds of supporters cheered.
"I came here just for the inauguration," supporter Antonio Vendramin told AFP.
"I made a lot of money and saved money to buy the ticket, to be able to buy the plane ticket because it's a long way to come by car but we managed to make it all the way to be here on this day for President Bolsonaro's inauguration. We're full of pride."
Who is Bolsonaro?
Despite portraying himself as a political outsider during his campaign, Mr Bolsonaro served seven terms in Brazil's lower house of Congress, the Chamber of Deputies, before being elected president.
He has been a member of several political parties but is currently in the Social Liberal Party (PSL), which has grown from having a tiny presence in Congress to becoming the party with the second largest number of deputies in the lower house.
Before becoming a politician, Mr Bolsonaro served in Brazil's military, where he was a paratrooper and rose to the rank of captain.
During the election race in September, he was stabbed at a rally and seriously injured, taking more than a month to recover.
During his time as a lawmaker, Mr Bolsonaro represented the interests of the armed forces and since his election he has named seven former military men to head key ministries.
He has also expressed nostalgia for the time when Brazil was under military rule and the hard-line policies enforced during the period, which saw thousands jailed and tortured.
Why did his election cause such a stir?
Brazil only returned to democracy in 1985 after more than 20 years under military rule, and some critics see his election as a threat to the country's democracy.
Previous comments he has made endorsing the use of torture and disparaging women, gay people and Afro-Brazilians have left many Brazilians worried.
The election campaign which brought him to power has left the country deeply divided into those who see him as the man to put Brazil on to the right track after massive corruption scandals, and those who fear he could lead Brazil into an authoritarian future.
What are his key policies?
Mr Bolsonaro's promise to drive down crime and stamp out corruption comes after scores of top businessmen and high-ranking politicians, including former left-wing President Luiz Inácio Lula da Silva, were jailed.
Days after being elected, he picked Brazil's most famous anti-corruption judge, Sergio Moro, as his minister of justice.
Mr Moro was the key force behind the massive "Car Wash" corruption investigation.
There was concern among environmentalists when Mr Bolsonaro suggested during the election campaign that the ministry of agriculture might be merged with that of the environment.
But he has backtracked on that and also revoked a pledge to quit the Paris climate accord, which sets targets for cutting greenhouse gases.
How will Brazil's international relations be affected?
Mr Bolsonaro has been very clear about who he considers to be his international allies and those he views as foes.
Mr Trump is "an example" to him, and Mr Bolsonaro has promised to follow the US lead and relocate Brazil's embassy in Israel from Tel Aviv to Jerusalem.
Mr Bolsonaro has accused Cuba of holding back some of the salaries paid to Cuban doctors working in Brazil, prompting Cuba to pull out its doctors in retaliation.