The German parliament on Friday approved a law allowing a third gender option on birth certificates for people who are not distinctly male or female.
Chancellor Angela Merkel's left-right coalition had passed legislation permitting children born intersex to be registered as "miscellaneous".
The new measure follows a ruling by Germany's top court in November 2017 that current regulations on civil status are discriminatory against intersex people, noting the sexual identity of an individual is protected as a basic right.
Intersex is a broad term encompassing people who have gender traits, such as genitals or chromosomes, that do not entirely fit with a typical binary notion of male or female.
According to the United Nations, between 0.05 and 1.7 percent of the global population are intersex -- about the same percentage as people with red hair.
Sometimes this is apparent at birth, at other times it becomes noticeable in puberty.
The new German law also allows changing a person's gender and name at a later stage, but it drew criticism because this will in most cases require a medical examination.
The Lesbian and Gay Association LSVD charged that this signalled that being intersex was seen as an abnormality and demanded that "degrading assessments... must be abolished".
However, conservative Christian Democrats lawmaker Marc Henrichmann argued that the official civil register must be based on evidence rather than self-assessments, reported DPA news agency.
Germany has since 2013 allowed babies born with characteristics of both sexes to leave the gender options of male and female blank.
The Federal Constitutional Court in its ruling gave parliament until the end of 2018 to amend the current legislation.
The decision was in favour of an appeal brought by an intersex adult and said that courts and authorities should no longer compel intersex people to choose between identifying as male or female.