Abu Bakar Bashir's conviction for incitement of terrorism followed two unsuccessful attempts by prosecutors over the past eight years to link him to terror activities, including a conviction that was later overturned in the Bali attacks that killed 202 people.
The relatively long sentence against Bashir, now 72, shows Indonesia's continuing resolve to tackle its deadly extremist movement.
The sentence was announced amid high security at a Jakarta court, where nearly 3,200 police and soldiers secured the area after bomb threats spread through Twitter and text messages.
Bashir, who denies involvement in terrorism, rejected the ruling, and his lawyer said it would be appealed.
"This verdict ignores Sharia law and is based on the infidel law, so it's forbidden for me to accept it," Bashir said in the courtroom.
Hundreds of Bashir's supporters, some carrying placards saying "Free Abu Bakar Bashir," reacted to the ruling with shock. Many shouted "God is Great" and others wept. Their leaders urged them to be calm. The crowd dispersed peacefully.
The ageing cleric has been a potent symbol for Indonesia's radical Islamists and, even if not operationally involved in terrorist attacks, is believed by experts to provide crucial ideological sanction for violent extremism.