Tens of thousands of Catalan independence supporters have marched through central Madrid in protest at the trial of 12 separatist leaders who helped organise the failed bid for independence from Spain in 2017 and to renew their call for a vote on secession.

The demonstration was organised by two powerful civil society groups, the Catalan National Assembly (ANC) and Òmnium Cultural, around the slogan: “Self-determination is not a crime. Democracy is about deciding.”

Hundreds of coaches were laid on to bring people to the capital from Catalonia and other parts of Spain.

Banners call for ‘freedom for political prisoners’. Photograph: Juan Medina/Reuters

The organisers said 120,000 people attended, well beyond their expectations. Police however put the number of marchers at about 18,000.

Police said the march passed off largely free of incident: a heavy security presence had been put in place to ensure that the event went ahead peacefully and that possible confrontations with far-right groups bitterly opposed to Catalan independence were avoided.

Many members of Catalonia’s pro-independence regional government attended the march, including the president, Quim Torra.

Torra’s predecessor, Carles Puigdemont, was not in Madrid. He was sacked by the Spanish government after organising the unilateral independence referendum in October 2017, and is living in self-imposed exile in Belgium after fleeing Spain to avoid arrest.

Protesters carry Catalan independence flags and yellow ribbons. Photograph: Pablo Blázquez Domínguez/Getty Images

Twelve of the pro-independence Catalan leaders who remained in Spain are currently on trial in Madrid over their alleged roles in the events that culminated in the staging of the referendum and the subsequent unilateral declaration of independence.

Puigdemont offered his solidarity to two of them, Jordi Sànchez, a regional MP and former president of the ANC, and Jordi Cuixart, the leader of Òmnium Cultural.

“Thank you for your steadfastness and dignity, Jordi Sànchez and Jordi Cuixart,” he tweeted earlier on Saturday. “Today in Madrid there will be a representation of a people that progresses in peace and solidarity, which wants more and better democracy, and which demands its right to exist and to be respected. Today will be a memorable day!”

Former Catalan vice-president, Oriol Junqueras, left, who is on trial, pictured in 2017 with the former Catalan president, Carles Puigdemont. Photograph: Manu Fernández/AP

Nine of those on trial, who include former Catalan vice-president Oriol Junqueras and former speaker of the Catalan parliament Carme Forcadell, are accused of rebellion, which carries a prison sentence of up to 25 years. Other charges include sedition and the misuse of public funds.

Torra told reporters in Madrid that the march was needed in order to decry the trial, which he described as a farce.