Iranian authorities on Wednesday jailed a woman who took off her hijab to protest against laws which mandate wearing the garment in public, BBC reported. The protester was sentenced to two years in prison, with a 21-month suspended sentence.

Tehran’s chief prosecutor Abbas Jafari-Dolatabadi said that the woman, who has not been officially identified, was found guilty of “encouraging moral corruption”. She has been imprisoned for three months without parole.

Dolatabadi added that woman could apply for parole after three months, The Guardian reported. He also described the sentence as “light” and said he would push for the full 24-month penalty.

The chief prosecutor added that the woman was “in need of medical treatment and has to be seen by a psychiatrist”.

In February, Iranian authorities had arrested 29 women for not wearing the headscarf in public. The action came after the picture of a woman standing on Tehran’s bustling Enghelab Street, waving her hijab on a stick, inspired a wave of protests against the law making it compulsory to wear the garment.

Iran’s Supreme Leader Ayatollah Ali Khamenei on Thursday said in tweets that the hijab keeps women “immune” from leading a “deviant” lifestyle similar to that in the West. “Today the flag of women’s identity and cultural independence is at the hands of Iranian women,” he added. “Iranian women today declare their cultural and identity independence and export it to the world while preserving their hijab.”