MADRID — A Spanish court on Thursday barred the leader of the restive northeastern region of Catalonia from public office for 18 months, for civil disobedience in his show of support for jailed separatists, in a ruling that is likely to fuel the anger of Catalan people who want to break away from Spain.

The ruling by a court in Barcelona dealt with yellow ribbons that are displayed throughout Catalonia in solidarity with separatists whose supporters consider them political prisoners of Spain’s central government.

Last spring, Quim Torra, the separatist regional president of Catalonia, refused to take down ribbons and other signs on public buildings, in defiance of an order by the electoral commission in Madrid that all partisan symbols be removed from such buildings during the political campaign leading up to a parliamentary election in April.

The ruling, which Mr. Torra said he would appeal, was the latest in a long series of clashes pitting Spain’s central government and its judiciary against Catalan leaders who favor independence. Politicians have failed for years to resolve the secessionist conflict, and it has increasingly been left to judges to handle, while continuing to split Catalan society down the middle and fueling street violence.