BANYUWANGI (AGENCE FRANCE-PRESSE) - An Indonesian environmentalist has been sentenced to 10 months in prison under a tough anti-communism law, a legacy of one of the darkest chapters in its history.

A court in East Java handed down the sentence on Tuesday (Jan 23) after finding Heri Budiawan, 38, guilty of spreading communism during a demonstration last year against the opening of a local gold mine.

Some protesters were seen carrying banners with an image of a hammer and sickle - a widely-recognised symbol of communism - during the protest and Budiawan was fingered as the rally organiser.

Three other banner-carrying protesters were also charged under the rarely-used law and are awaiting trial.

A change to the criminal code in the late 1990s made it illegal to spread communism or other leftist ideologies, with possible sentences of up to 12 years in jail.

"We are thoroughly dissatisfied with this verdict - this is a threat to democracy and freedom of speech," Budiawan's lawyer Ahmad Rifai told AFP on Wednesday (Jan 24).

Indonesia had one of the world's biggest communist parties before massacres in the mid-1960s left some 500,000 dead, including party members and suspected leftists. The mass killings happened as dictator Suharto seized power.

During his 32-year rule, the government's official narrative was that the killings had been necessary to rid Indonesia of communism.

Last year Indonesia's defence minister said suspected communists killed in the military-backed massacres "deserved to die".

Budiawan's lawyer said on Wednesday that his client and the other protesters did not make the banners and did not understand the hammer and sickle's link to communism.

Prosecutors had sought a seven-year prison sentence for Budiawan.

"The prosecution proved convincingly that the defendant committed a criminal offence against the state," presiding judge Putu Endru Sonata told Banyuwangi district court on Tuesday.

Hundreds of anti-communist group members protested against Budiawan outside the court as the verdict was read on Tuesday.

Last year prosecutors sought a two-year prison term for a 24-year-old goat herder who uploaded a selfie of himself holding a framed picture of the hammer and sickle. His trial is continuing.

Also in 2017, three university students were suspended from school for selling books about communism, Marxism and Leninism.