RALEIGH, N.C. — LGBTQ people in North Carolina can no longer be prevented from getting domestic violence protective orders, the North Carolina Court of Appeals ruled Thursday.

North Carolina had been the only state in the country to withhold emergency protections from people seeking protection from abuse by a same-sex partner, The News & Observer reported in 2019. That kind of protection is offered to couples of the opposite sex, and to married and divorced same-sex couples, but not for same-sex couples who are dating or who used to date.

But that ban is unconstitutional, the appeals court ruled in a 2-1 opinion Thursday.

The opinion written by Judge Linda McGee, a Democrat and the chief judge of the Court of Appeals, said LGBTQ people have the same right to liberty that other Americans have. That includes the right to make choices about their romantic partners, she said — and the right to be protected if that relationship becomes dangerous.

“By telling Plaintiff that her existence is not as valuable as that of individuals who engage in ‘opposite-sex’ relationships, the State is not just needlessly endangering Plaintiff, it is expressing State-sanctioned animus toward her,” McGee wrote.

The case that led to Thursday’s ruling came from Wake County, involving a lesbian ex-couple who are identified only by their initials. Their 2018 breakup led to allegations of harassment and a request by one of the women for a domestic violence protective order, which is also frequently called a DVPO or a 50(B) order.

But a Wake County judge denied her, pointing to language in state law that specifically says that when two people are in a dating relationship, DVPOs can be issued only against a partner of the opposite sex. So she appealed the ruling, ultimately leading to Thursday’s opinion that applied not just to her case but to all LGBT people seeking domestic violence protections in North Carolina.

Attorney General Josh Stein and Gov. Roy Cooper, both Democrats, had previously called the law unconstitutional and signed briefs supporting the plaintiff in this case.

“A big win for equality in NC!” Stein tweeted Thursday. “All people are equal no matter if you are straight or gay. Today, the NC Court of Appeals recognized that truth and that the NC and US constitutions guarantee it.”

“This decision is a win for equality and inclusion and for our fight against domestic violence in North Carolina,” Cooper said in a news release Thursday. “State laws should protect everyone equally, including our LGBTQ community, and this ruling makes that clear.”

Since the ruling wasn’t unanimous — Judge John Tyson, a Republican, dissented — the case could still go to the North Carolina Supreme Court. But if it doesn’t, or if the ruling is upheld, then North Carolina will no longer stand alone in denying domestic violence protections to gay, bisexual, lesbian or transgender people.

The ruling relies heavily on recent rulings from the U.S. Supreme Court, which in the last decade has ruled in favor of gay rights in several big cases including the decision to legalize gay marriage in 2013. Another key Supreme Court ruling came just a few months ago, in June, in the case of Bostock v. Clayton County. In the majority opinion written by Donald Trump appointee Neil Gorsuch, the court broadened the scope of protections for LGBT people being discriminated against because of their sexual orientation.

The state appeals court cited Gorsuch’s opinion in the Bostock case nearly two dozen times in its ruling Thursday, including to drive home the conclusion of its own ruling for North Carolina.

“Bostock includes a thorough analysis resulting in the conclusion that discrimination based upon a person’s ‘homosexuality’ or ‘transgender status’ is always also discrimination based on ‘sex,’ or gender,” their ruling said.

And since discrimination based on sex or gender is forbidden, they ruled, so, too, are laws such as North Carolina’s ban on DVPOs for people in same-sex relationships.