NEW YORK — People born in New York City who don’t identify as male or female will have the option of changing their birth certificates to “X” under legislation passed Wednesday by the City Council.

The bill adopted by a 41-6 vote will also allow parents to choose the “X” designation for their newborns, and it will permit adults to change the gender on their birth certificates without an affidavit from a doctor or mental health professional.

“Today is a historic day for New York in its role as a worldwide champion for inclusivity and equality,” said City Council Speaker Corey Johnson, a Democrat. “New Yorkers will no longer need a doctor’s note to change their gender on their birth certificates, and will no longer be treated as if their identity was a medical issue.”

Johnson said it’s important “to show our constituents that we see them, we have their backs and we respect them for who they are.”

Carrie Davis, a transgender advocate who chaired an advisory board on the gender marker change, called the legislation “exceptionally critical during this time of danger and uncertainty regarding health care and human rights for transgender Americans at the national level.”

Some states including California, Oregon and Montana allow individuals to change the gender on their birth certificates without a note from a doctor, but it’s unclear how many jurisdictions allow parents to select a nonbinary option for their newborns. The option could be used by parents of intersex children or by parents who want their child to be able to choose a gender at a later date.

Democratic Mayor Bill de Blasio is expected to sign the bill, which will go into effect Jan. 1.

Prior to 2014, New Yorkers seeking to change the gender on their birth certificates had to have undergone gender confirmation surgery first.

Legislation Johnson introduced then allowed people to change their birth certificates without surgery but left the requirement for a doctor’s note in place. The new law eliminates it.