(Reuters) - A former state policy that banned gay couples from becoming foster parents was the same as a “whites only” employment sign, the Nebraska Supreme Court wrote in a ruling released on Friday that affirmed a lower court’s decision.

The ruling comes four years after three same-sex couples filed a lawsuit against Nebraska, arguing that a 1995 state policy prohibiting gay couples from being foster care parents and adopting wards of the state is unconstitutional.

A state district court in 2015 ruled for the couples and ordered the state policy to be rescinded.

The state appealed to the Nebraska Supreme Court on the grounds that the couples did not have standing because they did not apply for and were not rejected for a foster care license or having a state ward placed in their homes.

The state also argued that the issue was resolved since it did not enforce the policy. The supreme court, however, noted that the policy was not removed from the Nebraska Department of Health and Human Services website until 2015, leading to confusion.

The policy indicated “that ‘heterosexuals only’ need apply to be foster parents,” supreme court justices wrote in the decision.

“It is legally indistinguishable from a sign reading ‘whites only’ on the hiring-office door,” the justices wrote, referring to hiring practices discriminating against minorities that have long been ruled unconstitutional in the United States.

The supreme court ruled that the state’s appeal has no merit and ordered the state to pay the couples’ court costs and attorney fees.

The office of state Attorney General Doug Peterson said in a statement that the appeal brought up “legitimate jurisdictional issues that needed to be considered by the court. The court has ruled,” the Omaha World Herald reported.