BARCELONA, Spain -- Police and violent protesters in Spain's restive Catalonia region clashed Saturday after a massive rally in Barcelona against the imprisonment of nine separatist leaders for their roles in an illegal 2017 secession bid.

The flare-up in violence came after a week of tense calm without major incidents following six days when Catalonia was rocked by riots each night after the Oct. 14 Supreme Court verdict that found 12 Catalan leaders guilty of sedition and other crimes. That outbreak led to 500 people, nearly half of them police, being injured and around 200 arrests.

Hundreds of mostly masked youths surrounded the National Police headquarters in downtown Barcelona and threw colorful plastic balls at the officers on guard. When they switched to raining down rocks and bottles, police charged with batons swinging and after a chaotic moment managed to extend a perimeter.

Earlier on Saturday Barcelona's police said 350,000 people rallied peacefully in the regional capital, many waving pro-independence flags for Catalonia. The rally was organized by the main pro-secession grassroots groups who want to create a new state in the northeastern corner of Spain. There were no repeated incidents in the rally that drew families from across the wealthy region.

"We cannot accept that (the prisoners) have been condemned to terms of nine to 13 years for defending the self-determination of Catalans," the president of the pro-secession grassroots group ANC, Elisenda Paluzie, said at the peaceful protest.

Nine Catalan officials were given sentences of nine to 13 years for sedition by the Supreme Court. Four of those were also convicted of misuse of public funds. The other three were fined for disobedience. They were all acquitted of the more serious crime of rebellion, which carries sentences of up to 25 years. Spain's most right-wing politicians called the verdict soft.

Spain's government has told Catalonia's separatists that the national Parliament would need to amend the Constitution, which considers the nation indivisible, to make secession by a region legal.

The largest pro-Spanish union grassroots group Catalan Civil Society has called for a rally in Barcelona on Sunday. About roughly one half of Catalonia's 7.5 residents oppose severing century-old ties with the rest of the country.

The Catalan crisis is set to be a key issue in Spain's Nov. 10 national election, where Socialist Prime Minister Pedro Sanchez will try to stay in power.

Earlier Saturday, Spain's far-right party Vox drew several thousand people to a political rally in central Madrid. Vox is trying to profile itself as the best option to stop the rupture of Spain.