THOUSANDS of people have joined protests across Catalonia after the Spanish supreme court removed president Quim Torra from office.

The court's ruling upheld a previous decision to ban Torra for 18 months because he refused to take down a banner supporting pro-independence leaders from a public building before the 2019 general election.

Pro-independence activists reacted by calling for protests across Catalonia.

Large demonstrations were organised by the Catlan National Assembly and Omnium Cultural, with a socially distanced rally held in central Barcelona.

Protests organised by the Committees for the Defense of the Republic were also held outside the Public Prosecutor’s Office, which was guarded by the Mossos d’Esquadra, who were pelted with pigs’ heads.

Local media reported that there were at least five arrests during the demonstrations.

Torra, speaking in a televised address surrounded by members of his cabinet, said: "No unjust law applied for the purpose of revenge against those who defend human and universal rights will ever be able to defeat democracy.”

He also called on Catalans to turn the next regional election into a de-facto plebiscite on independence by voting for separatists, and vowed to take his appeal against the ruling to European courts. "The only way forward is by democratically breaking away," he said.

According to existing regulations, Torra's deputy Pere Aragones should take over as president-in-charge until the regional parliament elects a new leader or a new election is held.

READ MORE: Aamer Anwar says Quim Torra's ban from office 'politically motivated'

Spanish deputy prime minister Carmen Calvo told reporters the deadlock should be resolved with a new election as soon as possible to reactivate dialogue between the regional and central authorities.

"The sooner Catalonia is ready to have the ability to work with the government of Spain, the better for everybody," she said.

In their ruling, the panel of judges unanimously agreed to uphold last year's decision by a lower court to ban Torra from holding any public office for 18 months and fine him €30,000.

Torra succeeded former president Carles Puigdemont following the 2017 independence referendum. Puigdemont was forced to flee to Belgium and has since been fighting extradition to Spain.

"Once more, the Spanish state interferes in our democratic institutions," the former president tweeted.

Torra had remained at the helm of Catalonia during the appeal but the supreme court’s decision must be implemented even if the case is taken to the European Court of Human Rights, as pledged by his defence team.

The banner at the centre of the case referred to a dozen former Catalan cabinet members, legislators and activists who were imprisoned or left Spain following a declaration of independence in October 2017.

The court on Friday said Torra had "stubbornly" disobeyed the country's electoral board by refusing to take it down from a balcony on the regional government's headquarters.

In hearings, Torra and his lawyers argued that he was defending the higher cause of political and human rights, but the Supreme Court judges said the electoral board's order did not violate his right to free speech, only limited what he could do in his role as an elected official.