An Iranian woman who publicly removed her headscarf in protest against Iran’s compulsory laws has been jailed to two years in prison, the judiciary said on Wednesday.

Tehran’s chief prosecutor, Abbas Jafari Dolatabadi, who announced the sentence, did not give the woman’s identity but said she intended to appeal against the verdict, the judiciary’s Mizan Online news agency reported.

Reports say that Dolatabadi said the unidentified woman took off her headscarf in Tehran's Enghelab Street to "encourage corruption through the removal of the hijab in public."

The woman will be eligible for parole after three months, but Dolatabadi criticised what he said was a “light” sentence and said he would push for the full two-year penalty.

The prosecutor said some “tolerance” was possible when it came to women who wear the veil loosely, “but we must act with force against people who deliberately question the rules on the Islamic veil.”

Since the end of December, more than 30 Iranian women have been arrested for publicly removing their veils in defiance of the law.

Most have been released, but many are being prosecuted.

Women showing their hair in public in Iran are usually sentenced to far shorter terms of two months or less, and fined $25.

Iranian law, in place since the Islamic Revolution of 1979, stipulates that all women, Iranian or foreign, Muslim or non-Muslim, must be fully veiled in public at all times.

Dolatabadi said he would no longer accept such behaviour, and had ordered the impound of vehicles driven by socially rebellious women.