(Reuters) - South Carolinians in same-sex relationships should get the same legal protection against domestic violence as heterosexual couples, the South Carolina Supreme Court ruled on Wednesday, finding part of the state’s domestic violence law unconstitutional.

The 1994 law partly violated the U.S. Constitution’s guarantee of equal protection under the law by setting out gender-based designations for members of households, the state’s five-judge high court said in its opinion.

Lawmakers had amended the definition of “household members” under the domestic violence law from “persons” living together to “male and female.”

“In this case, we cannot find a reasonable basis for providing protection to one set of domestic violence victims - unmarried, cohabiting or formerly cohabiting, opposite-sex couples - while denying it to others,” acting Justice Costa Pleicones said in his decision.

One other justice agreed with his finding, while the other judges agreed in part but dissented on some points.

The ruling stemmed from a case in which a woman, named as Jane Doe in the court filings, was denied a protective order against her former fiancée.

The South Carolina legislature overhauled the domestic violence law in 2015 to include harsher penalties for offenders and permanent protection orders, but left the sex-based designation of “household members” unchanged.

South Carolina Attorney General Alan Wilson, whose office argued the state’s case before the justices, said in a statement that he would ask the court to reconsider its ruling.

He said he backed an approach that would “reconcile our state’s domestic violence laws with U.S. Supreme Court precedent.”

“Under this current ruling the only people we can now protect are spouses, former spouses and people who have a child in common,” Wilson said.

Beth Littrell, a lawyer for Lambda Legal in Atlanta, said the ruling was the latest by courts around the country guaranteeing equal treatment for same-sex couples since the landmark U.S. Supreme Court decision in 2015 legalizing same-sex marriage.

“It’s another good decision recognizing that, regardless of whether or not state laws have caught up to the reality, that same-sex couples have equal dignity in the eyes of the law,” she said by telephone.