Being gay, lesbian, or unmarried will no longer disqualify people from adopting kids in Nebraska.

The state’s Supreme Court on Friday upheld the abolishment of a 22-year-old law prohibiting foster kids from being placed in households inhabited by “persons who identify themselves as homosexuals” or by unmarried people. The policy, enacted in 1995, also blocked LGBTQ individuals or couples from obtaining a license to serve as foster parents, which is required to adopt a child in the state.

Chase Strangio, an attorney with the American Civil Liberties Union’s LGBT and AIDS Project, fought the case alongside the ACLU of Nebraska and law firm Sullivan & Cromwell.

“The harm the plaintiffs wish to avoid is not just the possible, ultimate inability to foster state wards,” Judge John Wright wrote in the unanimous opinion. “It is the discriminatory stigma and unequal treatment that homosexual foster applicants and licensees must suffer if they wish to participate in the foster care system.”

Nebraska’s Supreme Court was upholding a lower court’s decision to strike down the law. Wright wrote that barring couples from becoming foster parents on the basis of their sexual orientation was “legally indistinguishable from a sign reading ‘Whites Only’ on the hiring-office door.”

In 2015, a district judge had rescinded the rule, but the state appealed the decision. Nebraska’s Department of Health and Human Services was not acting in accordance with the lower-court ruling during the appeal, leaving the foster care system in limbo, the state Supreme Court said on Friday.

The 2015 case was brought on behalf of three couples, including Lisa Blakey and Janet Rodriguez, who’d been together more than eight years. They wanted to become foster parents but were barred from doing so because of both their sexual orientation and the fact they were unmarried. Another couple in the case, Todd Vesely and Joel Busch, began applying to become foster parents in 2008. According to court documents, they passed required background and home checks before they, too, discovered that they were prevented from becoming foster parents because of the state policy.