At least eight protesters who had been holding out at a trashed Hong Kong university surrendered to police in the early hours of Friday, while others desperately searched for escape routes as riot officers surrounded the campus.

The siege at the campus on the Kowloon peninsula appeared to be nearing an end with the number of protesters dwindling to less than 100, days after some of the worst violence since anti-government demonstrations escalated in June.

Much of Hong Kong's Polytechnic University, which teemed with 33,000 students, faculty and staff in the most recent school year, has become a deserted wasteland.

Hundreds of anti-government protesters had fortified the campus and engaged in street battles with riot police earlier this week.

But now the number of protesters has dwindled to fewer than 100, turning the grounds into an eerily empty compound scattered with debris and defaced with political slogans.

Trash and debris from homemade petrol bombs were strewn across the grounds. Many protesters have abandoned their equipment, including gas masks and umbrellas.

A barricade is seen leftover inside the Hong Kong Polytechnic University. (Nicolas Asfouri/AFP via Getty Images)

Much of the campus is damaged, with rooms vandalized and windows shattered. Electricity and water are still functioning.

In a library, most books were untouched but makeshift petrol bombs were left on desks.

The protesters appeared to be outnumbered by media and people hoping to help, including some university staff, a group of Catholic clergy, and principals of secondary schools looking for any children still holding out.

A Catholic priest said his group had found the remaining protesters largely unwilling to engage.

Some protesters told Reuters they were holding out not for a showdown with police, but because they were innocent and looking for an escape route.

A protester walks in the gymnasium which served as a sleeping area on the campus. (Athit Perawongmetha/Reuters)

"We are feeling a little tired. All of us feel tired but we will not give up trying to get out," said a 23-year-old demonstrator who gave his name only as Shiba as he ate noodles with egg and sausage in the protesters' canteen.

"We spent yesterday trying to find ways to get outside but failed, so we came for some breakfast," he said.

"I won't consider surrendering. Surrendering is for people who are guilty. None of us inside are guilty," Michelle, a 20-year-old student, said on the campus of Polytechnic University on the Kowloon peninsula.

More than 1,000 protesters who tried to leave earlier this week were arrested, and most of those who remain say they hope to avoid being arrested for rioting or on other charges.

Last campus still occupied

The Chinese-ruled city has enjoyed two days and nights of relative calm ahead of district council elections that are due to take place on Sunday.

The government has said it is committed to proceeding with the elections and is monitoring the situation to ensure the election can be held safely.

All polling stations will be guarded by armed officers in riot gear for the first time in the history of local elections, the South China Morning Post reported.

Demonstrators are angry at what they see as Chinese meddling in freedoms promised to Hong Kong when the British colony returned to Chinese rule in 1997.

Beijing has said it is committed to the "one country, two systems" formula granting Hong Kong autonomy.

'I have nothing to lose'

The unrest marks the most serious popular challenge to Chinese President Xi Jinping since he came to power in 2012.

Some protesters have surrendered while others were held during escape attempts that included clambering down from a bridge to waiting motorbikes and fleeing through the sewers.

Riot police gather near a Louis Vuitton store during a demonstration in the financial district in Hong Kong on Wednesday. (Kin Cheung/The Associated Press)

Graffiti sprayed on campus buildings read: "I have nothing to lose. I have no stake in the society," summing up the mood felt by many of the protesters on Thursday morning.

Some looked for breakfast in one of the university canteens, which remained stocked with food, including noodles and tomatoes.

Cross Harbour Tunnel still shut due to damage

One protester, dressed in black clothes with gloves, elbow and knee pads, had about a dozen colourful lighters strapped to his chest. He told Reuters the remaining protesters were discussing what to do next.

In the past two weeks, protesters have torched buildings and public infrastructure, including a footbridge and toll booths at the city's Cross Harbour Tunnel linking Hong Kong island to the Kowloon peninsula.

Protesters sleep on the floor of a parking lot inside the Hong Kong Polytechnic University on Wednesday. A dwindling number of exhausted pro-democracy protesters barricaded inside the Hong Kong university defied warnings on Tuesday to surrender. (Nicolas Asfouri/AFP via Getty Images)

The protesters say that they are angry at the way the MTR, Hong Kong's public rail network, has helped riot police, and that shutting down key infrastructure forces the government to listen to their demands for universal suffrage and an independent inquiry into police violence, among other things.

The Cross Harbour Tunnel remained shut on Thursday because of extensive damage, authorities said.

Some train services remained shut, the city's metro operator MTR Corp said, while the rural Yuen Long station in New Territories would shut by 2 p.m. local time, to pre-empt demonstrations marking four months since suspected triad gang members attacked protesters and commuters there.

'Erroneous signal'

China has accused the United States and the U.K. of stirring up trouble in Hong Kong and it has criticized the U.S. House of Representatives over its passing of two bills aimed at supporting the protesters and sending a warning to China about human rights.

China resolutely opposed the bills and would never allow anyone to undermine the "one country two systems" principle, or to destroy Hong Kong's prosperity and stability, senior Chinese diplomat Wang Yi said.

China's state Xinhua news agency said a top Chinese official in Hong Kong, Xie Feng, had summoned the U.S. consul-general to denounce the legislation as gross interference and a violation of international law.

The Hong Kong government also expressed its strong opposition to the bills, saying they would harm Hong Kong's relations with the United States.

Protesters are escorted out of the main entrance to the Polytechnic University campus, the site of a multi-day standoff between demonstrators and police. (Nicolas Asfouri/AFP/Getty Images)

"The two acts will ... also send an erroneous signal to the violent protesters, which would not be conducive to de-escalating the situation," the city government said in a statement.

The anger over the U.S. legislation, which has been sent to President Donald Trump, who is expected to sign the bills, comes as the two countries are locked in delicate trade talks.