Donald Trump has been sworn in as the 45th president of the United States, while anti-Trump protesters clashed with police in the capital.

The number of protests against and rallies for Trump taking place on Friday is far above what has been typical at recent US presidential inaugurations.

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

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.

OPINION: Five thoughts to sober up the morning after Trump

The night before Friday's inauguration, thousands of people turned out in New York for a protest rally at the Trump International Hotel and Tower, and then marched a few blocks from where the businessman lives.

The rally featured a line-up of politicians, activists, and celebrities. New York Mayor Bill de Blasio, Hollywood actors Robert de Niro and Alec Baldwin, Oscar-winning documentary director Michael Moore and singer Cher were among those who joined the noisy gathering.

Moore, an Oscar-winning documentary filmmaker, exhorted the crowd to take part in "100 days of resistance", a movement to resist Trump's policies.

"As bad we think it's going to be, it's going to be worse. But the good news is there's more of us than there are of them."

In a call for unity Moore said: "We're all Muslim. We're all Mexican. We're all women. We're all American. Yes, and we are all queer, too."

READ MORE: Donald Trump: Making Doonbeg great again

Al Jazeera's Kristen Saloomey, reporting from the anti-Trump rally in New York, said speakers addressed crowds about their plans to oppose the Trump administration.

"It is not surprising for New York - the liberal and left-leaning city and state - to vote for Democrats in the presidential elections. What is surprising is seeing city and state officials coming out to vow to take on Trump's policies," Saloomey said.

One New York protester told Al Jazeera that Trump picked his cabinet as if he wanted to ruin US institutions.

"He is a gangster, he is a fascist, and he is a megalomaniac," a visibly angry woman told our correspondent.

Trump opponents have been upset by his comments during the election campaign about women, undocumented migrants, and Muslims, as well as pledges to scrap healthcare reform and build a wall on the Mexican border - paid for by Mexico.

READ MORE: The seven biggest threats to Donald Trump's presidency

Supporters admire his experience in business, including as a property developer and reality television star, and view him as an outsider who will take a fresh approach to American politics.

"We're going to get it turned around, we're going to bring our jobs back," Trump said at a rally on Thursday in Washington DC. "We're not going to let other countries take our jobs any longer.

"We're going to build up our great military, we're going to strengthen our borders. We're going to do things that haven't been done for our country for many, many decades."

Friday's crowds are expected to fall well short of the two million people who attended President Barack Obama's first inauguration in 2009, but in line with the one million who showed up at his second in 2013.

Forecast rain may also dampen the turnout, though security officials lifted an earlier ban on umbrellas saying small ones would now be permitted.

"I don't care, frankly, if it is going to be beautiful or if it is going to rain like crazy. It makes no difference to me," said Trump.