SALEM, Ore. -- In a move hailed by LGBT rights groups, Oregon became the first state in the U.S. on Thursday to allow residents to mark their gender as "not specified" on applications for driver's licenses, learner's permits and identity cards.

Under the new rule approved by the Oregon Transportation Commission, Oregonians who select the new option will have an X appear instead of M or F on those cards. The rule, which takes effect on July 3, is a first for the U.S., David House, spokesman for Oregon's Driver and Motor Vehicles Division, or DMV, told The Associated Press.

"It's fitting that this is before us during Pride Week in Oregon and Pride Month around the country," said Commissioner Sean O'Hollaren. "It's something that we should do because it's the right thing to do."

Get Breaking News Delivered to Your Inbox

The DMV said the new rule, which the commission passed unanimously, came about after a Multnomah County judge in June 2016 allowed Jamie Shupe, a Portland resident, to legally change to "non-binary" gender.

"There's a little more truth and justice in the world today," said Hayley Gorenberg, deputy legal director of Lambda Legal, the oldest and largest national legal organization that advocates for the civil rights of lesbians, gays, bisexuals, transgender people.

Gorenberg said in a statement that when appearances don't appear to match gender markers on ID cards, people "endure insults and psychological trauma that could largely be averted if they had an option to use a gender marker that does not contradict who they are."

Lambda Legal said that nationally, people have been harassed and even assaulted after presenting IDs to police, hospital workers, employers, airport staff, bank tellers and others that don't match their gender identity or expression.

DMV Administrator Tom McClellan choked up as he read letters of support to the commission, including from someone who encountered an embarrassing situation while going through a body scanner at an airport, and the security officer didn't know whether to push the blue button for a male passenger or a pink one for a female one.

House said Oregon is the first state or jurisdiction in the U.S. to create this option, but is not the first on the continent, and that the Canadian province of Ontario implemented the X option earlier this year.

"It's exciting to see Oregon's Department of Motor Vehicles adopt this change. We know gender is a spectrum and some people don't identify as male or female," said Nancy Haque, co-executive director of Basic Rights Oregon, the state's largest nonprofit LGBTQ advocacy group.

The group said other cultures and other countries that recognize non-binary genders include India, Bangladesh, Australia, New Zealand and Nepal.

In California, the state Senate by a 26-12 vote passed a bill on May 31 to add a third gender option on state IDs, sending it to the state Assembly. The California Family Council, a conservative Christian group, opposes it, arguing that "government documents need to reflect biological facts for identification."

The DMV said it studied state laws, updated computer systems, worked with law enforcement and courts and changed administrative rules to implement the change and comply with the Multnomah Court's order. Judge Amy Holmes Hen ruled that "The sex of Jamie Shupe is hereby changed from female to non-binary."

Shupe was quoted last year by The Oregonian/OregonLive as saying: "I was assigned male at birth due to biology ... My gender identity is definitely feminine. My gender identity has never been male, but I feel like I have to own up to my male biology. Being non-binary allows me to do that. I'm a mixture of both. I consider myself as a third sex."