Women in the Iranian capital will no longer be arrested for failing to wear a headscarf, Tehran police have said, in a move which follows an unexpected raft of gender reforms in Saudi Arabia.

Morality police will no longer automatically detain women seen without the proper hijab head-covering in public, a strict Islamic dress code in place since the 1979 revolution.

For nearly 40 years, women in Iran have been forced to cover their hair and wear long, loose garments.

Younger and more liberal-minded women have long pushed the boundaries of the official dress code, wearing loose headscarves that do not fully cover their hair and painting their nails, drawing the ire of conservatives.

The announcement signalled an easing of punishments for violating the country's conservative dress code, as called for by the reform-minded Iranians who helped re-elect President Hassan Rouhani, a relative moderate, earlier this year.

But hard-liners opposed to easing such rules still dominate Iran's security forces and judiciary, so it was unclear whether the change would be fully implemented.