Image caption Shyamal Kanti Bhakta denies allegations he insulted Islam

The Bangladeshi government has reinstated a headmaster who was sacked after being publicly humiliated over allegations that he insulted Islam.

Shyamal Kanti Bhakta, who is a Hindu, was made to hold his ears while performing squats, before being beaten.

Many Bangladeshis were angered by his treatment, posting photos of themselves holding their ears in solidarity.

The government said the sacking was illegal and dismissed the school board. Mr Bhakta denies insulting Islam.

"The head teacher was a victim of injustice. This was a heinous act," Education Minister Nurul Islam Nahid said.

But he made no mention of local MP AKM Selim Osman who was present at the teacher's ritual humiliation in Narayanganj District near Dhaka last Friday.

The MP has refused to apologise for what happened, the Daily Star reports.

Image caption The management committee at the school in Narayanganj District has been dismissed

Image copyright Facebook

In footage of Friday's incident, a crowd can be heard cheering as Mr Bhakta was made to squat repeatedly and folds his hands - an action associated with shame and apology and usually reserved for children.

Video and photographs showing Mr Bhakta's treatment soon went viral on social media.

Mr Bhakta has told the BBC his treatment was the result of personal grudges against him.

It comes in the wake of a series of attacks on secular writers and bloggers, professors and members of religious minorities in the country.