Under Islamic law in practice since the 1979 revolution, "hijab" -- which requires women to cover their hair and much of their body in loose clothing to prevent their figures being seen -- is obligatory.
"Some 4,000 demonstrators urged the authorities and people to take heed of the situation of hijab and chastity in the society," the official IRNA news agency said of the demonstration, which took place outside the interior ministry.
Pictures of the gathering showed both male and female protesters.
Fars news agency reported that "the demonstration didn't last long after Tehran police chief Hossein Sajedinia appeared at the rally and pleaded for it to end."
More From This Section
Hossein Hashemi, governor of Tehran province, said the demonstration was not legal since no permission was granted by the interior ministry.
"One who seeks to prevent vice should not commit such a violation (of law)," he told ISNA news agency.
President Hassan Rouhani, a self-declared moderate, asked Iran's police in October to be lenient on the hijab issue.
The soft-spoken president, who has the backing of reformists, moderates and some conservatives, campaigned for more cultural and social freedoms in the Islamic republic en route to winning last summer's election.