As Catalonia's separatist crisis drags on, Spain's judiciary has found itself on the back foot, accused of engaging in the type of partisanship normally associated with repressive dictatorships.
The region's sacked leader Carles Puigdemont says he is in Belgium because he would not get fair treatment back home, a claim only amplified when eight of his deputies were jailed last week pending investigation into charges of sedition and rebellion.
But while legal experts have criticised some aspects of the judicial response to Catalonia's independence drive, they reject claims that the system lacks independence.
- 'Political prisoners' -
Manuel Ruiz de Lara, spokesman for the advocacy group Civic Platform for Judiciary Independence, defends the independence of judges' decisions which he notes are often criticised or approved by politicians "according to their interests".
He says that if politicians like a decision they proclaim it the work of an independent judge, and vice-versa if they are opposed to it.
The Catalan crisis, which kicked off when separatist leaders held an independence referendum last month despite a court ban, has stoked passions in Spain.
Portrayed as a repressive state by supporters of secession, Spain was also accused of taking "political prisoners" when a Madrid judge sent the leaders of two Catalan pro-independence associations to prison pending investigation into sedition.
Last week, the same judge jailed eight Catalan regional ministers who had been sacked by Madrid.
By then, Puigdemont and four of his deputies had fled to Belgium.
In her ruling remanding the eight in custody, Judge Carmen Lamela decided among other things that it was too risky to set them free during the investigation as they could escape, given Puigdemont and others had already done so. Her decision caused outrage.
"Spanish justice has been placed at the service of the government's political agenda," wrote Puigdemont, who awaits possible extradition, in the UK's Guardian newspaper.
Still, while some question whether Lamela made the right decision, judges and legal experts believe she made it free of political influence.
"Judges are independent. That they may at times not be reasonable or sensible is another thing," says Xavier Arbos, a law professor at the University of Barcelona.
- Rebellion charge in doubt -
However, the charge of rebellion brought against separatist leaders, which in this case could be punishable by up to 25 years in jail, has drawn controversy.
Defined as "rising up in a violent and public manner," it is "disproportionate" according to Jose Maria Mena, a former chief prosecutor in Catalonia, given the peaceful nature of the independence drive.
Spain's chief prosecutor argues that independence supporters repeatedly intimidated and resisted police forces, which he says constitutes a form of violence.
For Mena, though, that equates to converting "social pressure generated by any protest in a democratic country... into rebellion".
"I don't know if he spoke to (Prime Minister Mariano) Rajoy before, it's very unlikely," he says.
But "the chief prosecutor thought that if he was very severe, the independence movement would weaken, which was an extra-judicial calculation".
- Governing body politicised? -
The perception that Spain's judiciary is biased has long simmered across the country -- not just in Catalonia.
In the EU's 2017 "Justice Scoreboard," Spain came third to last among 28 member states where public perception of the independence of judges and courts is concerned, behind Slovakia and Bulgaria.
"That really hurts," says Celso Rodriguez Padron, a magistrate in Madrid and spokesman for the Magistrates' Professional Association.
"I've had the opportunity to deal with penal cases where people from the political world were involved and I can guarantee it doesn't matter, a politician is judged with exactly the same criteria as anyone else," he says.
Lamela may have decided to jail Catalan separatists, he adds, but other judges have over the years remanded former members of the ruling conservative Popular Party (PP) in custody in various corruption cases.
Rodriguez says the negative perception may stem from Spain's General Council of the Judiciary (CGPJ), a powerful body in charge of appointing judges to the Supreme Court as well as presidents of high and regional courts.
In the 1980s a majority of the 20-member council was appointed by judges and the rest by parliament, but now the whole body is selected by the lower and upper houses.
"Judges have always asked that we return to the original system to stop people from believing that if the authority that governs the judiciary is appointed by political groups, then naturally those political groups will choose judges that agree with their ideas," says Rodriguez.
Critics say politics -- and whichever parties hold sway at the moment -- are deeply rooted in the nation's legal system.
And they also point to the nation's Constitutional Court, whose judges are put forward by the government, parliament and the CGPJ -- the court that declared the Catalan referendum illegal.
Madrid, Spain | AFP