Germany's top court Wednesday ordered parliament to recognise a "third gender" from birth, potentially making it the first European country to offer intersex people the option of identifying as something other than male or female.
The ruling, hailed as "historic" by Germany's Federal Anti-Discrimination Agency, marks a major shake-up for gender policies in Europe's biggest economy just a month after same-sex marriage was legalised.
Current regulations on civil status are discriminatory against intersex people, the Federal Constitutional Court said, noting that the sexual identity of an individual is protected as a basic right.
Legislators must by the end of 2018 pass a new regulation to offer a third gender option in birth registers, the court added, ruling in favour of an appeal brought by an intersex person.
In the meantime, courts and state authorities should no longer compel intersex people to choose between identifying as male or female, said the top court.
The plaintiff had brought the appeal after several lower courts had ruled against a bid to introduce the gender options "inter" or "various" in the birth register.
The intersex person was registered as female, but a chromosome analysis found the plaintiff to be neither male nor female.
Intersex is a broad term encompassing people who have sex traits, such as genitals or chromosomes, that do not entirely fit with a typical binary notion of male and female.
So intersex people would have features that are neither wholly female nor wholly male, or a combination or neither.
Berlin pledged to follow through with the ruling, with interior ministry spokesman Johannes Dimroth saying that the government "stands ready to implement it".
The Federal Anti-Discrimination Agency called the court ruling a "historic decision for intersex people" and urged lawmakers to "carry out a comprehensive reform of current legislation towards a modern gender identity law."
The agency's call was echoed by the pressure group German Institute for Human Rights which said parliament should overhaul current rules to "improve legal protection and recognition of the diversity of physical gender developments, gender identities and gender expression."
Welcoming the ruling, activist group Third Option said on Twitter that it was "completely overwhelmed and speechless. That's a small revolution in the gender area."
Under current rules, Germany allows babies born with characteristics of both sexes to leave the gender options of male and female blank.
The existing law is intended to remove pressure on parents to quickly make a decision about controversial sex assignment surgeries for newborns, but many advocates say it does not go far enough.
Wednesday's court ruling, therefore, takes a big step forward, by requiring a new gender option from birth.
According to the United Nations, between 0.05 and 1.7 percent of the global population is intersex -- about the same percentage that have red hair.
Sometimes this is apparent at birth, at other times it becomes noticeable in puberty.
People who identify as intersex are recognised on official documents in some countries, including Australia, India, New Zealand and Nepal.
Belgian runway model Hanne Gaby Odiele significantly raised awareness of neutral gender issues earlier this year by publicly revealing that she is intersex.
New York, America's largest and one of its most liberal cities, last year issued the first US birth certificate marked "intersex".
But in May, France rejected "neutral sex" on official documents, with its highest appeals court ruling against a request by a person born with neither a penis nor vagina.