The former Catalan vice-president Oriol Junqueras has used the last day of landmark proceedings against him and 11 other separatist leaders to defend the failed push for regional independence but also to plead for a political solution to the crisis.

The trial, which has lasted four months and heard testimony from 422 witnesses, has examined the events leading up to the unilateral independence referendum on 1 October 2017 and the Catalan parliament’s subsequent declaration of independence.

Nine of the 12 defendants – who include Junqueras; the former speaker of the Catalan parliament Carme Forcadell; and two influential grassroots activists, Jordi Cuixart and Jordi Sànchez – are accused of rebellion, which carries a prison sentence of up to 25 years.

Other charges include sedition and the misuse of public funds.

Addressing the judges at the supreme court in Madrid on Wednesday afternoon, Junqueras said: “Voting, or defending the republic in parliament, cannot constitute a crime. When it comes to human rights and fundamental freedoms, having the will to talk, to negotiate, to find agreement, should never be a crime.”

He said that although he understood the court had a decision to make, the Catalan question required a political, rather than judicial, answer.

“I genuinely believe that the best thing for all of us – for Catalonia, for Spain, for everyone – would be to see this issue returned to the sphere of politics – good politics – an area it should never have left,” he said.

Last week, the state prosecutor described the push for secession as a coup d’etat intended to “overturn, suspend the constitution completely or partially, and declare the independence of one part of the national territory”.

However, defence lawyers have rejected such arguments, pointing out that under Spanish law, rebellion involves “revolting violently and publicly”.

Junqueras’ lawyer, Andreu Van den Eynde, told the court on Tuesday that while there may have been “disobedience”, there had been no rebellion.

“Talking about a coup d’etat is confusing disobedience with rebellion,” he said. The offence of disobedience carries a fine and a ban from holding public office, but not a jail term.

The case has centred on the referendum, which was held in defiance of the then government of the conservative prime minister Mariano Rajoy, and of the country’s constitution, which is founded on the “indissoluble unity of the Spanish nation”.

Polling day was marred by a heavy-handed and violent response from some of the national and Guardia Civil police officers who had been deployed to the area before the vote.

Ballot boxes were forcibly seized, voters were dragged out of polling stations and hit with batons, and rubber bullets were fired.

Appearing as a witness in February, Rajoy blamed the violence on the Catalan authorities.

“If they hadn’t called people to vote in an illegal referendum and hadn’t made decisions that broke the law, neither you nor I would have had to see the injuries that some people and some members of the security forces had,” he told the court.

The trial has also focused on the events of 20 September 2017, when police raided Catalan regional government offices and arrested 14 senior officials in an attempt to head off the vote.

The raids brought thousands of Catalans out to protest. Guardia Civil officers found themselves trapped inside the buildings they were searching and three of their vehicles were vandalised.

The state prosecutor, Javier Zaragoza, said such behaviour constituted “physical, compulsive and intimidatory violence”.

He added: “The violent nature of an uprising does not mean there has to be either serious or armed violence.”

The former Catalan president Carles Puigdemont, who led the push for regional independence, is not among those on trial. He fled Spain to avoid arrest at the end of October 2017 and is living in self-imposed exile in Belgium.

Manuel Marchena, the chairman of the seven judges hearing the case, refused a request for Puigdemont to appear as a witness in the proceedings. “He can’t be a defendant in the morning and a witness in the afternoon,” said Marchena.

Although the trial phase is over, verdicts and sentences are not expected until the autumn. The defendants have already said they will appeal to the European court of human rights if necessary.