Night has descended on another day of protests in Barcelona, which saw the city's downtown filled with angry Catalans protesting the detention of fugitive former leader Carles Puigdemont in Germany.

Police dressed in riot gear struck demonstrators with batons as they tried to push back crowds advancing on the office of the Spanish government's representative in Catalonia.

Other protesters rallied in front of the office of the European Commission.

Catalan Mossos d'Esquadra regional police officers stand amid smoke from a smoke bomb during clashes with pro-independence supporters protesting the detention of fugitive former leader Carles Puigdemont in Germany

A sister protest erupted in the northern city of Girona, where Puigdemont was mayor before he became regional president in 2016.

Thousands answered the call by a pro-independence grassroots group to protest in the Barcelona's center hours after Puigdemont was detained by German police.

It comes after protests swept the city on Friday, continuing into Saturday, triggered by Spain's High Court jailing of five Catalan politicians who played a role in the region's declaration of independence.

However, a grassroots group in favor of Catalonia staying a part of Spain called for another gathering at the same time in Barcelona to show their support for the Constitution in front of the office of the Spanish government's representative in Catalonia.

Puigdemont fled from Spain in October following an illegal declaration of independence by the region.

His lawyer Jaume Alonso-Cuevillas confirmed German police stopped him on Sunday when he was crossing the border to enter Denmark.

Spanish intelligence officers used a tracking device hidden in Puigdemont's car to follow him from Finland and orchestrate the arrest.

Spanish news website OK Diario described the device as "the size of a fingertip" and said it had been placed manually in the Belgian-plated Renault Espace he was held in after he crossed the border into Germany from Denmark.

It quoted a source involved in the surveillance operation on Puigdemont following his rushed decision to leave Finland on Friday to head back to Belgium as saying: "The tracking device can be hidden in countless places thanks to its size.

"The movement of the vehicle always has to be confirmed by field agents or international police forces who co-operate to make sure that inhibitors can't frustrate the follow."

Intelligence officers from Spain's National Intelligence Centre are also said to have kept tabs on Puigdemont through satellite tracking of his mobile phone.

They tipped off German authorities once he had entered Germany so he could be held on a European Arrest Warrant Spanish judge Pablo Llarena reactivated on Friday after Puigdemont flew to Helsinki from his Belgian hideaway to give a speech.

Flames rise from a burning trash container during clashes between riot police and demonstrators

A man sits on the ground holding his head as Catalan Mossos d'Esquadra regional police officers clash with protesters after sundown

A firefighter douses a burning trash container, set alight during street clashes in Barcelona

Protesters hold a banner while waving pro-independence Catalan Esteleda flags during the demonstration outside the EU Commission offices in Barcelona

The former Catalan leader Carles Puigdemont is understood to have been detained by German police

A vehicle believed to have been carrying Carles Puigdemont left a police station in Schuby, Germany, this afternoon

The car was accompanied by a police escort. Puigdemont will appear in court tomorrow

Police armed with batons strike protesters gathered in the heart of Barcelona today

Protesters shout slogans opposite riot police blocking the road leading to the central government offices in Barcelona

Protesters stretched a black banner across streets in the centre of the city which read 'It's just about Freedom'

Catalonian riot police members and protesters clash after demonstrators were called to the streets by the Republican Defense Committee

Puigdemont will appear before a judge tomorrow, court officials said.

'The sole purpose of this appearance is to verify the identity of the person arrested. The regional tribunal of Schleswig-Holstein in the town of Schleswig will then have to decide if Mr Puigdemont has to be taken into custody' in view of handing him over to Spain, the court said.

The court will then decide if Puigdemont will be formally taken into custody pending extradition proceedings, it added.

Judges 'will establish on the basis of documents provided by the Kingdom of Spain... if Mr Puigdemont's transfer to the Spanish authorities is legally founded,' the court said.

It added that the 55-year-old was currently in detention without providing further details.

Riot police block the road leading to the government offices in Barcelona

A protester holds a mask of Catalonia's former president Carles Puigdemont who has been detained in Germany

Protesters shout slogans while holding signs calling for the release of jailed Catalan separatists

The Schleswig prosecutor's office said in a statement that 'the question of whether Mr. Puigdemont has to be taken into extradition custody, will then have to be determined by the higher regional court in Schleswig.'

The statement says that the court will check, based on extradition documents by Spain, if the handover of Puigdemont to Spanish authorities is 'legally permissible.'

Another former Catalan minister wanted by Spain for her role in last year's independence bid was also 'making arrangements' to surrender to authorities in Scotland, where she had fled to.

A few hours after Puigdemont was arrested in Germany, a spokesman from Police Scotland said: 'We can confirm that we are in possession of a European arrest warrant for Clara Ponsati.

A protester scuffles with riot police during the third day of protests

A woman commands riot place to hold their ground as they attempt to contain the protest

'We have made a number of enquiries to try to trace her and have now been contacted by her solicitor, who is making arrangements for Ms Ponsati to hand herself into police.'

Scotland's leader says officials are legally obliged to follow the extradition procedures for a fugitive Catalan politician in Scotland, even though her government strongly opposes Spain's decision to arrest and imprison Catalonia's separatist leaders.

Scottish First Minister Nicola Sturgeon said that Scotland's support for Catalan self-determination is 'well-established,' adding on Twitter on Sunday: 'I know that many will wish @scotgov was able to do or say more - I understand that.'

But she said that Scottish officials must follow extradition laws, and that the independence of the legal system must be respected despite the government's political views.

Spain's Supreme Court said Friday it would prosecute 13 key Catalan separatists including Ponsati for 'rebellion', a crime which carries a maximum penalty of 30 years in jail.

A protester shouts in the face of a riot officer who holds his ground

Hawkers sell Barcelona football t shirts to pro-independence protesters