A lawsuit arguing that daughters should be allowed to succeed their fathers as chiefs in Lesotho has been rejected by the Constitutional Court.
The judge said the current law did not discriminate against women, as chief's widows could inherit the title.
South African lawyer Priti Patel, who was involved in the case, said the ruling was "a dark day for women in Lesotho".
Lesotho was recently ranked highly for its treatment of women.
It came eighth in the world - higher than the US and UK - for its progress in bridging the gender gap between the sexes by the World Economic Forum (WEF) in 2011.
This was partly because a high proportion of Lesotho's women go to school and work.
The lawsuit was brought by Senate Masupha, who was not allowed to become a chief when her father died. Instead, her mother took the title.
"This shows that women are not discriminated against but have to be in a certain position to take over the vacant position," said judge Ts'eliso Monaphathi, in remarks quoted by the AFP news agency.
"I do not feel that the princess can claim that any of her rights have been infringed."
In a statement Ms Patel, from the Southern Africa Litigation Centre (SALC), said: "The Constitutional Court has basically reaffirmed the view that women are second-class citizens in Lesotho."
She said the decision was a "significant step backwards" after the progress of recent years.
The SALC helped Ms Masupha bring the case.