Hasanuddin, who goes by a single name, was accused of masterminding the 2005 attack on Sulawesi island, buying the machetes and leaving a handwritten note at the scene vowing more killings.
He faced a maximum penalty of death, but judges at the Central Jakarta District Court handed down a 20-year-sentnece
The militant said Wednesday he was prepared to die for the gruesome murders.
The Central Jakarta District Court was scheduled to hand down its verdict later Wednesday. Prosecutors have asked judges to sentence Hasanuddin to 20 years behind bars, though he faces a maximum penalty of death by firing squad.
"I am ready for whatever sentence is handed down," Hasanuddin, wearing a cream-colored traditional Muslim shirt, told reporters while waiting in the court's detention room.
"God will punish" authorities if they hand down a guilty verdict, he said.
More than 90 percent of Indonesia's 220 million people are Muslims, but Central Sulawesi province - the scene of religious clashes that left at least 1,000 people dead from 1998 to 2002 - has a roughly equal number of Muslims and Christians.
A peace agreement ended the worst of the violence, but tensions flared after the 2005 beheadings and again in September 2006, after the execution of three Roman Catholic militants convicted of leading a 2000 attack on an Islamic school that killed up to 70 people, the AP said.
In January, 15 alleged Islamic militants were killed in a gunbattle in Sulawesi. Several others were arrested, including three who have confessed to taking part in the beheadings.
The discovery of the submarine has unveiled a few "inconsistencies." For example, how can one explain the fact that the sub was found where it needed to be searched for from the start?