The National Court, the top criminal court in the country, also ordered that Mudhar Hussein Almalki be put on probation for nine years after his release from jail.
A three-judge panel ruled that the Jordanian-born Saudi national "belonged to the propaganda apparatus of the Ansar al Mujahideen Network since 2006" which is "without a doubt" an "Al-Qaeda satellite group".
Almalki ran online forums linked to this group dedicated to "recruiting terrorists" and glorified Mohamed Merah, a self-proclaimed jihadist who killed four Jews, including three children, and three soldiers in France in 2012, the court said in its written ruling.
The court said Almalki drew up a list of targets which included former British prime minister Tony Blair, former Spanish prime minister Jose Maria Aznar and former US presidents George Bush and Bill Clinton, who he called "war criminals".
Police detained Almalki, who has lived in Spain since 1980, in March 2012 in the eastern city of Valencia. He was 51 years old at the time.