Egypt's military rulers have been ordered to stop the use of virginity tests on female detainees, Euronews reported.
The ruling was made by a court in Cairo.
Activists, some of whom demonstrated outside the courthouse, hailed it as a victory over the generals who took control after President Hosni Mubarak was ousted earlier this year.
"Nobody would accept being subjected to such treatment," one demonstrator said.
"This is an indecent assault and a kind of torture, used as a way to pressure the revolution and to pressure women, so we don't speak out."
The court ruling came after Samira Ibrahim brought a case against the Egyptian army.
Ibrahim claimed that she and six others were forced to undergo tests to see if they were virgins.
after they were arrested during a protest in Cairo's Tahrir Square.
The military's treatment of women was also criticised this month when female demonstrators were beaten.
Pictures showing one protester being dragged along the street and stamped on outraged Egyptians and the international community.