Donald Trump has been officially sworn in as the 45th president of the United States.

The inauguration took place outside US Capitol in Washington, DC on Friday, ushering in a new political era.

"Together we will determine the course of America and the world for many, many years to come," Trump said in his inaugural speech.

"We will face challenges, we will confront hardships, but we will get the job done."

He added: "For too long a small group in our nation’s capital has reaped the rewards of government. Washington flourished, but the people did not share in its wealth."

He also pledged to unite the world against "radical Islam".

After finishing his inaugural speech, Barack Obama, the outgoing president, tapped his shoulder and said, "Good job, good job".

Trump, a 70-year old businessman, has no previous political experience. He is a former reality TV star whose campaign dominated headlines over his shocking comments on minorities, women and rival politicians.

During the run up to the November 8 election, he promised to ban Muslims from entering the US. He also promised to build a wall along the Mexican border to deter Mexicans from travelling to America. Later, a recording of him saying that he grabs women's genitals when the mood takes him was leaked.

Speaking at the inauguration, Chuck Shumer, a senator from New York, said that America is now living in a "challenging and tumultuous time" ahead of the oaths.

"Faith in our government, our institutions and even our country can erode," he said. "Today we celebrate one of democracy's core attributes: the peaceful transfer of power."

Chief Justice John Roberts administered the oath of office, which was witnessed by Trump's wife, the First Lady Melania Trump.

Mike Pence, vice president, was also sworn in ahead of a crowd of an estimated 900,000 people.

Clashes and protests

About 28,000 security personnel, kilometres of fencing, street barricades, and trucks laden with sand were part of the security cordon around eight-square kilometres of central Washington for the ceremony.

In Washington, DC, anti-Trump protesters were pepper-sprayed by police officers in sporadic clashes.

Black-clad activists protesting Trump's inauguration smashed shop and car windows in the capital on Friday and fought with police in riot gear who responded with pepper spray and stun grenades.

About 500 people, some wearing masks and kerchiefs over their faces, marched through the city's downtown, breaking the windows of a Bank of America branch, a McDonald's outlet and a Starbucks shop, all symbols of the American capitalist system.

The crowd, which carried at least one sign that read "Make Racists Afraid Again", also vandalised several cars and hurled trash cans and newspaper vending boxes into the streets before being largely dispersed by police.

"The message I want to send is that Trump does not represent this country. He represents the corporate interests," said Jessica Reznicek, a 35-year-old Catholic aid worker from Des Moines, Iowa, who participated in a peaceful march.

Not far from the White House, protesters scuffled with police, at one point throwing aluminum chairs at an outdoor cafe.

Earlier, liberal activists with a separate group called Disrupt J20 intermittently blocked multiple security checkpoints leading to the largest public viewing area for the ceremony. Several were led away by police.

Disrupt J20 protest organiser Alli McCracken, 28, of Washington, said the group was voicing opposition to Trump's discriminatory comments about women, undocumented immigrants and Muslims.

"We have a lot of people of diverse backgrounds who are against US imperialism and we feel Trump will continue that legacy," McCracken said on a gray morning with light rain.

Trump supporters also flooded into the capital, many sporting shirts and hats bearing his "Make America Great Again" campaign slogan.

Other protests and demonstrations took place across the country, and in the rest of the world.