An Indonesian woman who doctors say should receive psychiatric treatment was acquitted on Wednesday of blasphemy charges for taking a dog into a mosque.

Suzethe Margareth was released after a panel of three judges at Cibinong District Court in West Java province absolved her of the charges because of her mental health.

“The defendant cannot be convicted because of her inability to take responsibility as she has psychiatric disorders,” presiding judge Indra Meinantha Vidi said in the ruling, “What she has done was part of her mental illness.” Many Muslims consider dogs to be impure.

A video that circulated online in Muslim-majority Indonesia last July shows a dog running around a mosque in the West Java district of Bogor while a visibly upset Margareth argues with shocked worshipers.

Angered conservative Muslims pressured police to bring the case to court.

Blasphemy is a criminal offence in Indonesia with a maximum penalty of five years in prison. The dog, which was chased out of the mosque, died a day later when it was hit by a car as members of an animal welfare group tried to capture it.