Chattogram's Cyber Tribunal Judge Md Zahirul Kabir delivered the verdict on Tuesday in the case under the Information and Communication Technology Act, 2006.
The convict, Debabrata Das Debu, was an assistant teacher at the Chowmuhani High School in Noakhali's Hatia.
He must also pay a fine of Tk 20,000 or risk facing an additional six-month jail term, the court ruled.
Debabrata, who was in court for the judgment, was later sent to jail, said Public Prosecutor Mezbah Uddin Chowdhury.
"The schoolteacher had given a confessional statement to the court. The court also heard testimonies of six witnesses before reaching the verdict."
According to the case dossier, Debabrata made some comments about Islam on Facebook on Oct 15 and 28, 2017. He was later confronted by a group of people outside the school for 'disparaging' the religion on Oct 31.
Police then arrested him and started a case under the ICT Act, the predecessor of the Digital Security Act.
The charges against him were framed by a cyber tribunal in Dhaka on Jun 10, 2018. The case was then transferred to the Chattogram Divisional Cyber Tribunal for trial.