Alexander Aan, 30, was imprisoned for sharing explicit material about the Prophet Mohammed online.
A court in western Sumatra heard that Aan started an atheist group on Facebook, where he shared comic strips of the prophet having sex with his servant.
He also uploaded three articles on the social networking site, including one describing the prophet being attracted to his daughter-in-law, The Daily Mail reports.
A judge found Aan guilty of ''deliberately spreading information inciting religious hatred and animosity’.
“Under the Electronic Information and Transactions law, we sentence him to prison for a length of two years and six months,” the paper quoted the judge, as saying.
“What he did has caused anxiety to the community and tarnished Islam,” he added.
According to the paper, Aan was beaten by an angry mob and arrested by police in his hometown of Pulau Punjung in western Sumatra in January after posting the material online and declaring himself an atheist.