"According to a decision of the commander of the police force, those who do not observe Islamic codes will no longer be taken to detention centres nor judicial files opened on them," Brigadier General Hossein Rahimi said in a speech.

"We offer courses and 7913 people have been educated in these classes so far."

In the past, offenders were escorted to a police vehicle and their family called to bring appropriate clothing. Once they are dressed, the offender would then be asked to promise - in writing - that they wouldn't do it again.

Those rules will still apply outside Iran's capital of Tehran, a local news agency said, and legal action could still be brought against repeat offenders in the city.

But it still marks a notable shift in attitude in Iran, following a surprise change to laws in equally conservative Saudi Arabia back in September, which allowed women to drive.