Carrie Lam has been sworn in as Hong Kong's chief executive by Chinese President Xi Jinping as the city marks the 20th anniversary of its return to Chinese rule.

Lam took her oath in Mandarin Chinese and not in the local Cantonese on Saturday amid scattered protests.

Security was tight at the same harbour-front venue where two decades earlier, the last colonial governor, Chris Patten, tearfully handed back Hong Kong to Chinese rule at a rain-soaked ceremony.

"I'm facing the biggest call of my career," Lam said after being sworn in.

"In the next five days, I'll be speaking to my team and making sure I do not let the central government or the people of Hong Kong down."

Minor scuffles broke out under a blue sky as pro-democracy activists - some with banners bearing the words "Democracy. Self-determination" - and pro-Beijing groups taunted each other, with hundreds of police deployed on a traditional day of protest in Hong Kong.

Scores of democracy protesters were taken away by police, while several pro-China groups remained, cheering loudly and waving flags as though in victory.

"Long live China", they shouted in unison. "We support the police's law enforcement actions."

"There's a very heavy police presence here and there are far more people in the pro-China rally than we've seen in previous years," Al Jazeera's Rob McBride, reporting from Hong Kong, said.

READ MORE: Hong Kong-China tension: Sheung Shui, a frontline town

"Down here, people are singing patriotic songs. You do get a sense that this is very well organised. It seems most of the groups are from mainland China and it's difficult to know how many local from Hong Kong are part of that group."

Britain returned Hong Kong to Chinese rule on July 1, 1997, under a "one country, two systems" formula which guarantees wide-ranging autonomy and judicial independence not seen in mainland China.

Beijing-backed civil servant Lam was chosen to be Hong Kong's next leader in March by a 1,200-person "election committee" stacked with pro-China and pro-establishment loyalists.

Heightened tension

Xi's visit comes amid heightened tension between China and Hong Kong.

Hong Kong's pro-democracy activists have been protesting against what they say is China's growing encroachment on the city's freedoms in a breach of the "one country, two systems" arrangement.

Beijing's refusal to grant universal suffrage to Hong Kong triggered nearly three months of street protests in 2014 and growing calls for independence for the city, in what many observers see as the most tumultuous post-handover period seen in Hong Kong.

Xi conceded on Friday the "one country, two systems" formula faces "new challenges" but that it shouldn't be handled with an "emotional attitude".

Emily Lau, the former chairwoman of the Democratic Party of Hong Kong, told Al Jazeera that the mood in Hong Kong is "very sombre".

She added, however, that "the Hong Kong people are very happy to see the back of Leung Chun-ying, who was the chief executive for the last five years and who really wreaked havoc in Hong Kong".

Lau said many have high hopes for Lam who has said "she wants to heal the wounds, work with the pro-democracy people, as well as the pro-Beijing camp ... but the big question is whether Xi Jinping and the liaison office in Hong Kong will allow her to do it".

More than 100,000 protesters are expected to take to the streets for an annual march in the afternoon to mark the 20th anniversary of the handover.