Thousands of people rallied in Spain's capital on Saturday to demand an end to Supreme Court trials of a dozen Catalan separatist leaders, who face charges ranging from rebellion to misuse of public funds in connection with an outlawed independence referendum in 2017.

The pro-independence president of the northeastern Spanish region of Catalonia, Quim Torra, several officials in his administration and members of separatist political parties were among those taking part in the demonstration.

The rally was organized by more than 60 civil society groups under the banner "Self-determination is not a crime" and "Democracy is about deciding."

Torra urged Spain's government to hear the demonstrators' "cries of freedom," saying "we won't stop, nor will they stop us."

Many of the participants arrived at the rally carrying Catalan flags, ballot boxes and signs demanding the withdrawal of charges against pro-independence leaders who either are jailed while on trial or - like Torra's deposed predecessor, Carles Puigdemont - have fled Spain to avoid arrest.

The demonstrators from Catalonia arrived in the Spanish capital in more than 500 buses, as well as by high-speed rail and private vehicles. Other protesters from Madrid and other parts of Spain also took part in the rally.

Around 500 National Police officers were on hand to ensure the demonstration unfolded peacefully.

A separate demonstration to express opposition to Catalan independence and support for Spanish unity was held earlier Saturday in Madrid.

Twelve pro-independence Catalan leaders have been on trial before Spain's Supreme Court since Feb. 12 for their role in an outlawed Oct. 1, 2017, referendum on "self-determination" and a subsequent unilateral declaration of independence by Catalonia's parliament that same month.

The Spanish Senate responded to the independence measures by voting in late October 2017 to trigger Article 155 of the Constitution, which saw the region's autonomy reeled back and its Parliament dissolved.

Prosecutors are seeking prison terms ranging from between seven and 25 years in prison for the alleged crimes of rebellion, misuse of public funds and/or disobedience, while the Solicitor General's Office, which is under the direct control of the central government, accuses the defendants of crimes including sedition (rather than rebellion) and is seeking prison terms of between seven and 12 years.

Puigdemont, who was president of the Catalonia region at the time of the 2017 referendum, and several other pro-independence leaders have been living in self-imposed exile in European countries for more than a year to avoid arrest in Spain.

They were among 13 Catalan separatist leaders charged with rebellion last year by a Spanish Supreme Court judge.