By James Pomfret

HONG KONG (Reuters) - A small group of Hong Kong pro-democracy protesters broke into the city's legislature via a side door early on Wednesday, and police stopped others forcing their way in as tensions in the Chinese-controlled city escalated following a period of calm.

The flare-up came just hours after court bailiffs managed to clear part of a protest camp in the heart of the city that has been occupied by pro-democracy demonstrators for nearly two months, while leaving most of the main protest site intact.

About 100 riot police with helmets, batons and shields stood guard outside the government building in the early hours of Wednesday, facing off with protesters who are demanding free elections for the city's next leader in 2017.

"Police retreat!" the protesters chanted.

It was the first time protesters had broken into a key public building, defying the expectations of many political analysts who had predicted that Hong Kong's most tenacious and protracted protest movement would slowly wind down.

The escalation came in the early hours of Wednesday when a small group of protesters charged toward the legislature and used metal barricades and concrete tiles to ram a glass side door. They eventually smashed through, with several managing to get inside, according to witnesses.

Scores of riot police, some with shields and helmets, rushed over, using pepper spray and batons to keep other demonstrators from also smashing their way in.

Police raised red signs warning protesters to stay back as the activists held up a wall of umbrellas to defend themselves against the pepper spray.

A democratic lawmaker at the scene, Fernando Cheung, said he and other protesters had tried to stop the small group of radical activists from breaking through.

"This is a very, very isolated incident. I think it's very unfortunate and this is something we don't want to see happen because the movement so far has been very peaceful," he said.

Story continues

On Tuesday, about 30 court bailiffs arrived at the 33-storey Citic Tower, also in the Admiralty district, to enforce an injunction forbidding street barricades after a request from the building's owners.

A similar injunction has been issued, but not yet enforced, for a street in the gritty district of Mong Kok, across the harbor, which has seen some of the most violent clashes of the past seven weeks.

Hong Kong was returned to China from British colonial rule in 1997 under a "one country, two systems" formula that gives the city more autonomy and freedom than the mainland, with an eventual goal of universal suffrage.

The protesters are demanding open nominations in the city's next election for chief executive in 2017. Beijing has said it will allow a vote in 2017, but only between pre-screened candidates.

(Additional reporting by Tyrone Siu; Editing by Anne Marie Roantree and Kevin Liffey)