BERLIN — Germans will now be able to choose “diverse” as an option for gender on birth certificates and other legal records, after the country’s Parliament passed a measure introducing the third category on Friday, in a milestone for people who do not identify as either male or female.

The change came more than a year after Germany’s highest court ruled that binary gender designations were discriminatory and in violation of guarantees of personal freedom. The court ordered legislators to change the law to include a third category or do away with gender classification altogether.

Under the new law, adults must produce a doctor’s statement or other medical certification confirming their gender fluidity in order to change their existing designation to the new option.

That condition met with criticism from groups representing lesbian, gay, bisexual and transgender Germans. They argued against relying on medical certification to establish gender, saying physical indicators are not the sole determinant.