The trial of 12 Catalan separatist leaders over their role in Catalonia's failed 2017 independence bid is due to wrap up tomorrow after four months of hearings.

They comprise nine former ministers in Catalonia's regional government, including former Catalan vice-president Oriol Junqueras, as well as the ex-speaker of Catalonia's parliament, Carme Forcadell.

Also on trial were the leaders at the time of the secession attempt of the two biggest grassroots pro-independence associations in Catalonia, Jordi Sanchez of ANC and Jordi Cuixart of Omnium Cultural.

They are accused of breaking the law by helping organise a referendum despite a court ban before making a short-lived declaration of independence in October 2017, sparking Spain's worst political crisis in decades.

Public prosecutors argue they carried out a "perfectly planned strategy... to break the constitutional order and obtain the independence of Catalonia" illegally.

The 12 defendants (C-L) chat at the start of the trial

Controversially, nine of the 12 Catalan leaders have been charged with rebellion, which according to Spanish law implies a violent uprising against the state.

To justify the charge, prosecutors point to "aggressions" police officers say they suffered when they tried to stop the 1 October 2017 independence referendum from going ahead.

They also point to "violent incidents" in Barcelona on 20 September 2017 outside a Catalan government building raided by police as part of a crackdown against referendum preparations.

Protesters destroyed several police vehicles.

Prosecutors argue the defendants "fomented, favoured and sought the direct confrontation between the crowds of citizens and police".

The chief prosecutor of Spain's National Court, Javier Zaragoza, has argued that "rebellion does not require serious violence or armed violence".

But the decision to charge the Catalan leaders with rebellion deeply divides legal experts. The defendants deny the secession bid involved any violence.

They point out that police used batons and rubber bullets on would-be voters on the referendum day, images that tarnished Spain's image.

"If you read, listen and observe our actions, no one could have the least doubt that we reject violence," Junqueras told the court in February.

Enrique Gimbernat, a criminal law professor at Madrid's Complutense University, insists rebellion has been "proven" since the accused "told people to go vote (in the referendum)... knowing violence was inevitable".

But Argelia Queralt, a constitutional law professor at the University of Barcelona, argues prosecutors misinterpreted the criminal code.

While there were "acts against the constitution" and "some one-off" violent incidents during the referendum, there was no "clear violence" that could justify a rebellion charge, she adds.

The central government's attorneys, who are representing the government against the defendants, share this view.

Unlike the prosecutors, who represent the state against the defendants, they decided not to seek rebellion charges, preferring instead the charge of sedition which carries a shorter prison term.

In addition to rebellion, prosecutors also accuse the nine former Catalan regional government ministers of misusing public funds to stage the banned referendum.

During the trial, experts from Spain's finance ministry estimated that at least €917,000 in public money was used, mainly to finance a publicity campaign for the referendum.

Prosecutors have called for jail terms of seven to 25 years in the case of Mr Junqueras, who is the main defendant.

Seven other politicians involved in the independence push - including former Catalan president Carles Puigdemont - are living in self-imposed exile abroad.

The former Catalan president was in Dublin in January for a debate on independence, nationalism and democracy at Trinity College