“Self-determination is not a crime,” read a banner at the front of the protest led by regional president Quim Torra which municipal police said was attended by 200,000 people, while organisers countered 500,000 had taken part.
Demonstrators waved blue, red and yellow Catalan separatist flags and carried banners reading “Freedom for political prisoners.”
The trial of 12 Catalan separatist politicians and activists over their role in the 2017 attempt to break Catalonia from Spain started on Tuesday at Madrid's Supreme Court.
They face up to 25 years behind bars on charges of rebellion and other offences for pushing an independence referendum in October 2017 in defiance of a court ban, and for a brief declaration of independence.
The independence bid sparked Spain's deepest political crisis since the transition to democracy in the 1970s after the death of dictator Francisco Franco.
Violence or no violence?
Independence supporters and the defendants' lawyers maintain they are on trial for their ideas.
“What's happening is really sad. It's a political trial, full of manipulations to sentence them for something that isn't a crime,” said Jesus Rodriguez, head of a group of “castellers,” Catalonia's famous tradition of human towers, at the Barcelona protest.
“They just want to lock them up and as they know that voting isn't a crime, they're inventing violence that never happened,” added the 48-year-old.
Prosecutors, though, insist the separatist leaders and activists are being tried for their actions and not for what they think.
Many Spaniards support the trial, shocked by the actions of Catalonia's regional executive in October 2017. Controversy, however, has swirled over the charge of rebellion.
Under Spanish law, rebellion is defined as “rising up in a violent and public manner”. But opinion is divided over whether the independence bid was violent.
At the trial on Wednesday, prosecutor Fidel Cadena said “what is penalised… is behaviour carried out over time which aimed… at the subversion and rupture of the constitutional order, calling for violent methods through the use of the masses as human shields” against police.
Supporters of independence deny the accusation of violence.
They instead condemn a police operation to shut down the referendum, which saw voters beaten with batons and dragged away from polling stations, images of which were seen in media around the world.
Oriol Junqueras, the main defendant of a trial that is scheduled to last three months, also rejected any claims of violence.
“If you read, listen and observe our actions, no one could have the least doubt that we reject violence,” he said at his hearing on Thursday.