Image copyright AFP Image caption Blasphemy carries a jail term of up to five years in Indonesia

A mentally ill woman has been spared jail in Indonesia for blasphemy after carrying a dog into a mosque.

A video of Suzethe Margaret entering a mosque wearing shoes before letting her dog run around went viral in July.

It sparked anger in the Muslim-majority country where many consider dogs to be impure.

A panel of judges in Bogor, a town near Jakarta, found her guilty of blasphemy on Wednesday but said she could not be held responsible for her actions.

Margaret has paranoid schizophrenia, according to psychiatric examinations in 2013.

Prosecutors had demanded she be sentenced to eight months of imprisonment.

What happens in the video?

The visibly distressed woman enters the mosque in Bogor stating she is Catholic and saying her husband is due to be married in the mosque later that day.

She accuses the mosque of converting him to Islam as the dog runs around. People from the mosque say they have no knowledge of the wedding.

The woman then kicks a guard when told to leave.

The dog reportedly later died after being hit by a vehicle.