Twelve Catalan separatists have appeared in court to face sedition charges carrying sentences of up to 25 years in prison in what Spanish media are calling the trial of the century.

Madrid’s Supreme Court was locked down by security officials as small but highly vociferous protests took place outside, both for and against the separatist leaders who are accused of crimes linked to their role in the region’s illegal independence referendum in 2017.

Police lined streets outside the plush neo-Georgian square where the court is based, as a group of some 100 pro-Catalan protesters hurled slogans in support of those on trial. Some protesters held up posters quoting Thomas Jefferson, saying (in Spanish): “When the law is unjust, rebellion becomes an obligation.”

The night before the trial an unknown individual projected giant TV pictures of Spanish police charging demonstrators during the 2017 referendum onto the facade of the court building, under the title “Spanish democracy”.

Then, at exactly 10am, when the trial started, supporters of the far-right Falange movement unfurled a giant poster with caricatures of the 12 separatists as devils. Others yelled “Golpista!” [Coup plotter!] as Catalonia’s current leader, Quim Torra, entered the building to support those on trial.

Every time that Catalonia has revolted - in pictures Show all 14 1 /14 Every time that Catalonia has revolted - in pictures Every time that Catalonia has revolted - in pictures Reapers' War In 1640, amidst the Thirty Years War, Philip IV of Spain sent his Castilian soldiers into the Catalan region to defend the border with France. The soldiers were not on their best behaviour and drew the ire of the Catalan peasants and politicians alike, at a time when the region was already agitated by economic decline. On June 7, reapers arriving to Barcelona for seasonal harvest work were dismayed to find little of the sort and blamed the stationed soldiers. After a reaper was killed, the revolt began in full force with a fierce uprising known as Corpus de Sang (depicted here in a 1910 painting by Ermenegild Miralles) Ermenegild Miralles i Anglès Every time that Catalonia has revolted - in pictures Reapers' War More Castilian forces arrived, strengthening the Catalan resolve and leading Pau Claris, President of the Generalitat (Catalonia's political assembly) to declare Catalonia an independent republic on January 17 1641. A week later the republic swore its allegiance to Louis XIII of France and the war came to a head at the Battle of Montjuïc (depicted above by Pandolfo Reschi) where the Franco-Catalan forces were victorious. Following negotiations, Catalonia became an independent republic under the protection of France Pandolfo Reschi Every time that Catalonia has revolted - in pictures War of the Spanish Succession As Charles II of Spain died in 1700 without an heir, a variety of nations and other powers across Europe had their own ideas of who ought to succeed him. Catalonia sided with the Austrians, English and the Dutch in endorsing Archduke Charles of Austria, a Habsburg. Unsuccessful in their aims, they were violently brought back under the Spanish crown by the victorious Phillip V. (Depicted above is the Battle of Almansa, a decisive battle in the War of the Spanish Succession) Ricardo Balaca Every time that Catalonia has revolted - in pictures Tragic Week The conflict of the Tragic Week of July 1909 resulted from Spanish Prime Minister Antonio Maura's desire for power gains in Morocco. He relied on, mostly poor, Catalonian conscripts for the cause, who questioned the motives of the conflict and doubted their chances of survival Every time that Catalonia has revolted - in pictures Tragic Week A general strike commenced on Monday 26 July. By midday the crowds had set fire to the San José Workers’ Foundation, the first of around 80, mostly religious, buildings that they would burn that week. Soldiers and police barricaded streets and fought openly with the strikers Alamy Every time that Catalonia has revolted - in pictures Tragic Week By the end of the week, the police and army had taken control. Over 1000 strikers were arrested and 5 leading figures executed. This caused disgust across Spain and wider Europe and the episode contributed to the downfall of Maura's government Getty Every time that Catalonia has revolted - in pictures The Spanish Civil War In the Spanish Coup of July 1936, Republican forces opposed the Nationalist presence in Catalonia. The National Confederation of Labour (CNT), an anarchist organisation, began to take hold of power in Catalonia AFP/Getty Every time that Catalonia has revolted - in pictures The Spanish Civil War As the CNT took control of the Generalitat, companies and organisations were ordered to collective control Getty Every time that Catalonia has revolted - in pictures The Spanish Civil War Nationalist forces eventually regained control of the territory. Pictured are their tanks entering Barcelona in 1939 Getty Every time that Catalonia has revolted - in pictures The Spanish Civil War Barcelona nationalists rejoice at the arrival of General Franco's forces. Catalonia, along with the rest of Spain, was to remain under dictatorship until 1975 Getty Every time that Catalonia has revolted - in pictures Independence Referendum 2017 In 2017 the Generalitat passed a motion that a referendum would be held on Catalan independence. The Constitutional Court of Spain ruled that the referendum was a breach of the Spanish constitution, therefore illegal Reuters Every time that Catalonia has revolted - in pictures Independence Referendum 2017 Catalan government buildings were raided in the lead up and polling stations were blockaded by police on the day but the vote went ahead illegally. Turnout was 43% and of those 92% voted for independence Reuters Every time that Catalonia has revolted - in pictures Independence Referendum 2017 Catalan President Carles Puigdemont declared victory and is pictured here signing a declaration of independence on October 27. Warrants were issued for the arrest of Puigdemont and five other Catalan politicians and the Spanish government did not recognise the result and imposed direct rule over Catalonia, as opposed to its then status as an autonomous community of Spain Reuters Every time that Catalonia has revolted - in pictures 2018 A year on from the vote Spain has ended direct rule in the region and dropped the arrest warrants. But on the anniversary of the vote, more than 180,000 protesters took to the streets of Barcelona with the cry "1 October, no forgiving, no forgetting" AFP/Getty

“This is a trial against everybody’s civil rights, anybody who thinks this is only against the pro-independence movement is mistaken,” claimed Gabriel Rufian, an outspoken MP for the Catalan Republican Left, as police hustled a small group of separatists away.

“All we should ask is, ‘Who’s going to be next?’”

Mr Rufian’s party leader, former Catalan vice-president Oriol Junqueras, was one of the 12 inside the court. Mr Junqueras faces up to 25 years in prison if convicted of rebellion and misuse of public funds.

In the trial’s opening session, largely given over to procedural and technical questions, some political issues were nonetheless raised.

Mr Junqueras’s lawyer, Andreu Van den Eynde, claimed defendants had the right to seek self-determination and said that “practically all” their rights had been ignored.

“Mr Junqueras has been removed from the political arena,” Mr Van den Eynde said. Other defence lawyers questioned the impartiality of the judges in the case.

Some 600 witnesses are expected to testify, amongst them former Spanish prime minister Mariano Rajoy, as the trial unfolds over the next three months. The Spanish government is anxious to show the trial is being fairly conducted, and it will be broadcast live on TV in its entirety.

The best-known separatist leader, Carles Puigdemont, is not on trial, having fled after Catalonia’s failed declaration of independence, but his image looked down from posters featuring a picture of a chicken – a sarcastic reference to his current self-imposed exile in Germany – which appeared on walls near the court.