MADRID — The Catalan independence push of October 2017 was a bold political move — and it ended badly for the main characters.

Spain’s Supreme Court on Monday convicted 12 separatist leaders on charges of sedition, disobedience and misuse of public funds, sentencing them to prison terms of up to 13 years.

Acting Prime Minister Pedro Sánchez said the ruling is the end of the road for a secessionist movement that he claimed had “failed” to gain either internal or external support.

But if Socialist Sánchez no longer sees a threat to Spain’s “territorial integrity," as he did back in 2017, he would do well to watch his back ahead of a general election on November 10.

The court decision means he will have to navigate a minefield during the campaign — and some factors will be out of his control, including the scale of public protests in Catalonia and the attitude of the Catalan government.

"There will be lots of noise, many high-flown statements … but not an outbreak like the one of 2017" — Oriol Bartomeus, politics professor in Barcelona

Spanish right-wing parties tend to perform well at the ballot box on matters of national unity and Monday’s ruling means the election campaign will all be about Catalonia — providing little incentive for hard-liners on all sides to calm things down.

Here are three factors that will determine Spain's political future:

1. The independence camp's unpredictability

The ruling was more lenient than the prosecutor had sought — and it angered right-wing commentators for that very reason — but it nonetheless triggered the ire of the independence camp.

Regional President Quim Torra called the ruling “an act of vengeance, not an act of justice.” Protesters took to the streets across Catalonia as soon as the sentence was out. By the evening, roads and railways had been blocked, more than 100 flights to Barcelona had been canceled and the regional police had charged against demonstrators at the airport.

How it will go from here is less clear.

The independence movement has been split since 2017, with some advocating further confrontation and others restraint. The proximity of the election and competition between the two main secessionist parties offers incentives for hard-liners, while the ruling means Catalan leaders now know what could happen to them if they push too far.

“The Generalitat [Catalan government] has two possible paths,” said Andreu Mas-Colell, a Catalan economist and regional minister between 2010 and 2016 under a previous secessionist administration.

“One is institutional disobedience,” he said, which in his view will end up with Madrid applying direct rule over the region, as it did in 2017 in response to the declaration of independence. Another, he argued, “is the path of declarative disagreements but not of institutional disobedience.”

“I don’t think they will dare to do the same [push for independence]. There will be lots of noise, many high-flown statements … but not an outbreak like the one of 2017,” said Oriol Bartomeus, a politics professor at the Autonomous University of Barcelona.

A more unpredictable factor is whether the public protests trigger a major incident or end up with someone seriously hurt, which could escalate the crisis to a new level, Bartomeus warned.

2. Sánchez seeks the right balance

When he took office last year, Sánchez adopted a new strategy on Catalonia.

In contrast to the previous, conservative administration of Mariano Rajoy, Sánchez promoted dialogue with Catalan authorities. He implemented an aggressive and relatively more sophisticated public relations campaign against them at the international level, while also vowing to uphold the constitution, which says the country cannot be split up.

How much emphasis there was on dialogue and how much on upholding the law — in other words, has he preferred the stick or the carrot — has varied depending on the political situation. On Monday, as in recent months, Sánchez brandished the stick, warning that his government stands ready to respond to any challenge with “democratic firmness, proportionality and unity.”

Spanish right-wing parties traditionally gather support from those fond of national unity, both inside Catalonia and in the rest of Spain, while the Socialists feed from a more diverse crowd and have often relied on a good performance in Catalonia for success at the national level. This makes Sánchez’s electoral equation even more complex.

Maintaining a balance ahead of the ballot won’t be easy for Sánchez, with rivals on the right and the left attacking the Spanish leader on Monday, either for having had pro-independence parties as partners in parliament or for being too hard by ruling out a potential pardon for the convicted Catalan leaders — which Sánchez seemed to do in his statement on Monday.

The conservative Popular Party, the far-right Vox and the liberal Ciudadanos attempted to frame the last general election in April as a referendum on Sánchez’s Catalan policy and painted the PM as a traitor. They failed, with polls indicating that Catalonia wasn’t among the most important worries for citizens. But they will get a second chance in November.

SPAIN NATIONAL PARLIAMENT ELECTION POLL OF POLLS

For more polling data from across Europe visit POLITICO Poll of Polls.

Sánchez will be sure to remind voters that he was fiercely criticized for pushing the state's attorney to accuse Catalan leaders of the lesser charge of sedition during the proceedings, instead of the prosecutor's choice of rebellion. That the court eventually endorsed the attorney's view could play to his advantage.

Against this backdrop, if things get out of control in the streets, or if the regional government embarks on an insurrectionist push, Sánchez will be tempted to prove to the electorate that he’s up to the challenge by using extraordinary measures to impose order, such as direct rule — and he’s already warned that he’s ready to do just that.

3. Spain’s chronic illness

The Spanish establishment, including the PM, may claim that the separatists have been defeated and no longer see Catalan independence as an existential threat, but it's not going away.

Support for independence has remained at around half the population of Catalonia in recent elections.

In 2017, support for secessionist parties was 47.5 percent in the regional ballot, which took place with independence leaders already jailed awaiting trial, the regional government under the control of Madrid, and images of riot police charging against voters in the October referendum fresh in people's minds.

As a result, support for independence didn't reach much beyond Catalonia’s traditional nationalist base, but it did result in a new pro-independence regional government in Barcelona.

“I hope the sentence will become a wake-up call for the independence camp and that they see it as an opportunity to turn the page" — José Manuel Albares, top adviser to Pedro Sánchez

That balance appears the same and signs are that it will stay that way.

Even though Sánchez has repeatedly cautioned that the crisis will take “decades” to solve, he has of late promoted the view that the court ruling should be a turning point. “Violating the constitution isn’t a way to achieve anything,” said José Manuel Albares, the top international adviser in the PM’s office.

“I hope the sentence will become a wake-up call for the independence camp and that they see it as an opportunity to turn the page,” Albares said.

For the time being, and barring unexpected moves, the Spanish government will have to continue to handle a regional government with ample powers and the economic means to attempt to portray Spain as a fascist state on the global stage.

“It is in the common interest that this stays a low-intensity conflict,” said Mas-Colell, the economist. “Any intention to achieve independence unilaterally — for those who believe it was possible — well, they’ve already seen it is not.”