The three other defendants in the landmark ruling over a banned referendum and short-lived independence declaration were found guilty only of disobedience and not sentenced to prison. All defendants were acquitted of the most severe charge, rebellion.
Much is at stake, both for Spain and for its wealthiest region in this trial over an independence drive that attracted worldwide attention, triggered Spain's biggest political crisis in decades and unnerved financial markets.
The main questions are how separatists will react to the verdicts, whether the promise of peaceful protests holds and whether and how the reputation of both Spain and the separatist movement could be affected.
Both the government and separatists circulated their own video on social media ahead of the verdict. Separatists say they have done nothing wrong and the trial was political, the government says the trial strictly followed the law.
"The only verdict we will accept is acquittal," the center-right separatist party of Catalonia's former leader, Carles Puigdemont, said in a video.
The government's own video showed several ministers defending Spain's democratic system. Acting prime minister Pedro Sanchez tweeted the video, with a message describing Spain as one of world's "most free and safe" countries.
The longest prison term went to former Catalan deputy leader Oriol Junqueras, who was given 13 years.
Four of the leaders were convicted of misuse of public funds.
Separatist protests have been largely peaceful but police sources have said authorities are prepared for potential violence.
The government has said it is ready to take direct control of Catalonia, as it did briefly in 2017, if leaders of the movement break the law.
The ruling is likely to color a national election on Nov. 10, Spain's fourth in four years, scheduled for Nov. 10, and influence the direction taken by the separatist movement.
An opinion poll in July showed 48.3% of Catalans against secession and 44.0% in favor.