Occupy London encampment cleared by City of London Jason N Parkinson/reportdigital.co.uk

St Paul's Cathedral has been accused of "betraying" Occupy London activists after giving the City of London police permission to remove protesters from its steps and end the four-and-a-half month camp.

The cathedral's decision, coupled with a previous high court decision obtained by the City of London, meant police successfully removed the entire Occupy London Stock Exchange camp from the square outside St Paul's.

Police said 20 people had been arrested by 4.30am in the "largely peaceful" operation.

Police and bailiffs moved in to begin clearing the Occupy London encampment in the early hours of Tuesday morning. Activists protesting against the financial and banking elite were told by bailiffs that they had five minutes to pack their tents and leave or they would be obstructing a court order.

Dozens of activists started clearing away tents and belongings, but others began building a barricaded enclosure using wooden pallets and debris.

Hundreds of police officers with riot helmets ready by their sides and dozens of bailiffs in yellow vests waited alongside rubbish lorries and watched the eviction.

One protester, Ed Greens from north London, said he had been with Occupy since last year. "We were expecting them on Monday night or soon after," he said. "Some people will resist things like this, but for me personally there is nothing wrong with self-defence."

At midnight five spotlights illuminated the square as the standoff continued. At 2am the lights were briefly switched off. When turned on again, four people, believed by protesters to be police officers, were standing on the balcony of the cathedral. Soon after, police revealed to press that they had the cathedral's permission to remove protesters from its steps.

"I was shocked to see policemen on the balcony," said Naomi Colvin, a spokeswoman for Occupy. "It seemed to be collusion. Tammy [another activist] just gave an interview saying how betrayed she felt when she learned the cathedral gave permission for us to be removed from its steps.

"That wasn't covered in the high court orders – it's like St Paul's has learned nothing from the last four months."

The canon chancellor of St Paul's, Giles Fraser, resigned in October over attempts by the cathedral to remove protesters by compulsion. Fraser was on the edge of the eviction, but police refused to let him cross a cordon to get closer.

Shortly after 3am police removed around a dozen demonstrators standing on kitchen shelving as a makeshift fortress as other riot officers with shields advanced along the cathedral steps removing protesters, some of whom were praying.

Among those protesters was Jonathan Bartley, director of the Christian thinktank Ekklesia, who claimed he was kicked repeatedly by police and dragged away from the cathedral.

"What happened is a great sadness – it is exactly as Giles Fraser warned might happen," he said.

"The tragedy is that while Christians were praying on the steps of St Paul's Cathedral, the cathedral gave permission for them to be forcibly and violently removed. The cathedral has backed and colluded in this eviction."

By 4am, no protesters or camping equipment remained in the square.

No one from St Paul's Cathedral was available to comment.

A City of London statement said: "We regret that it has come to this, but the high court judgment speaks for itself, and the court of appeal has confirmed that judgment. High court enforcement officers employed by the City of London Corporation are undertaking the removal with the police present to ensure public safety and maintain order. We would ask protesters to move on peaceably.

"The City of London Corporation is ensuring vulnerable people are being helped and supported to find appropriate accommodation in partnership with Broadway, a charity for the homeless."

An Occupy London spokesperson said its School of Ideas in a disused school building in Islington, north London, had also been evicted.

Supporter Kai Wargalla, a 27-year-old student from Germany who has been camping at St Paul's since the occupation began on 15 October, said: "It's really sad what's happening today but I think we can be proud of what we've achieved. Our community is being attacked here, but we're going to reconvene and come back stronger."

Wargalla, one of several trained "legal observers" who were monitoring the eviction on behalf of campaigners and reminding them of their rights, said many of the campers planned to go to one of the group's other sites in Finsbury Square instead, and extra tents would be put up following the unexpected eviction from the School of Ideas.

"We hadn't expected to be evicted from the cathedral steps because previously the church has said it would give us sanctuary when there's a violent eviction," she said.

"There was also some really unnecessary tension and stress caused by the police when they told us we had five minutes to take our things from the camp.

"It wasn't that violent today, but the violence we did see came from the police and the bailiffs."

An Occupy press release sent early on Tuesday morning said the movement would continue.

"The natural question to rush to in these moments is: 'What next?' In the short term, there will be a GA [general assembly] at 7pm on Tuesday by the steps of St Paul's," it said.

"In the medium term, it is only right that people will need time to rest, reflect and recharge, to take stock and learn the lessons of the past four and a half months. But be assured that plans are already afoot: plans of some ambition, employing a diversity of tactics and delivered with the aplomb you would expect from us. All will be revealed in time. May is one of our favourite months."