People hold a Catalan separatist flag and pictures of Catalan politicians during a protest in Barcelona following the court ruling on Monday. (Rafael Marchante/Reuters)

Spain’s Supreme Court sentenced nine Catalan separatist leaders Monday to prison terms of between nine and 13 years, a ruling that triggered immediate protests and a police response.

A 2017 referendum on Catalan independence, which Madrid deemed illegal, and the subsequent trial of those behind it have split Spanish society like no other events since the country’s democratic transition in the mid-1970s after the death of dictator Francisco Franco.

In response to Monday’s ruling, separatist sympathizers in Catalonia vowed massive civil disobedience in a rejection of a process they deemed overly harsh. National police forces descended on Barcelona, the Catalan capital, as demonstrations began in haste.

“These have been political proceedings, putting people on trial solely and exclusively for their political ideas,” said Alfred Bosch, Catalonia’s Minister for Foreign Action, Institutional Relations and Transparency.

“The prison sentences imposed upon the nine Catalan leaders represent a historical error that, far from solving the problem, merely worsens it,” he said in a statement.

Still, at least one Catalan civic group said it would respect the court’s ruling. In a statement, the Catalan Civil Society urged local authorities “not to call for confrontation.”

Three other defendants were found guilty merely of disobedience, which means they will be fined but not serve prison time. All 12 defendants were acquitted of the more serious charge of rebellion, but top Catalan officials were given the lengthier sentences.

Spanish prosecutors initially sought a prison term of 25 years for Oriol Junqueras, Catalonia’s former vice president and the highest-ranking Catalan official on trial. Junqueras was ultimately given a sentence of 13 years, the longest the court handed down.

Following the ruling, Junqueras said Monday that Catalan independence was “closer than ever.” His comments were relayed by his Republic Left party.

“A total of 100 years of prison. How horrible. Now more than ever, we will be with you and your families. For the future of our sons and daughters. For democracy. For Europe. For Catalonia,” said Carles Puigdemont, Catalonia’s former regional president, in a statement on Twitter. Puigdemont fled Spain to Belgium after calling the 2017 referendum.

The ruling looks set to play a role in Spanish elections in early November, the fourth vote the country has held in four years. Spanish Prime Minister Pedro Sánchez, a Socialist, failed to form a government after winning a general election in April, largely because of a standoff with smaller parties on the far left and political center.

Political analysts saw the vote in the context of Spain’s mounting political fragmentation. There are two political parties in the Spanish parliament that support Catalan independence, and it was unclear how the verdict in the Catalan trial would affect the upcoming election.

“It’s either going to get the pro-independence political parties more votes, or people will come to the conclusion that we’ve been through this now, we have a sentence, and they won’t get votes,” said William Chislett, an analyst at the Elcano Royal Institute, a Madrid think tank.

“Which way it’s going to go is anybody’s guess.”

McAuley reported from Paris.