MADRID — The sentencing on Monday of 12 former leaders of Catalonia’s independence movement for their involvement in a failed attempt to break away from Spain in 2017 has set off days of protests and reignited long-running tensions in the region.

The territorial dispute and its ramifications have loomed over Spanish politics since Catalan separatists gained momentum for their cause — culminating in a 2017 referendum that was deemed unconstitutional by Spain — and declared independence. The central government in Madrid cracked down and imposed a period of direct rule on the region, quashing the attempt at secession and ousting its separatist government.

But the lengthy prison sentences handed down to the leaders have prompted a new wave of unrest in the region at a pivotal time for Spain, which heads into a national election next month, the fourth such vote in the country in four years.

What happened in the ruling?

The Supreme Court sentenced nine leaders to between nine and 13 years in prison for sedition as well as misuse of public funds. Another three politicians were found guilty of the lesser crime of disobedience during the turmoil of 2017.