Is distributing intimate photos of current or previous sexual partners without their consent protected by the First Amendment? A state appeals court says yes.

Now it will be up to the state attorney general's office to defend the state's "revenge porn" law, which was passed in 2015 and punishes those who post intimate images from previous or current relationships online.

The Tyler-based 12th Court of Appeals said the law is unconstitutional because it's too broad and infringes on free speech, The Texas Tribune reported.

In his findings in the case, Chief Justice James Worthen said the First Amendment usually prohibits "content-based" restrictions.

The court also said that the law was vague and infringed on the rights of third parties who might unwittingly share intimate images, according to the Associated Press.

I am disappointed to learn that a state appeals court has struck down Texas’ “revenge porn” legislation that made it illegal to post intimate photos on the internet without consent. This type of disgusting act must be punished. #txlege https://t.co/oLZP1UuIdC — Matt Shaheen (@MattShaheen) April 19, 2018

In its ruling, the court ordered charges to be dropped against Jordan Bartlett Jones, who challenged the law as unconstitutional while awaiting trial for sharing a naked photograph of a woman without her consent.

The ruling applies only to about a dozen northeast Texas counties that fall under the jurisdiction of the 12th Court of Appeals, but other courts would likely consider its reasoning, the Tribune reported.

The law originated from complaints from women who said they felt violated and abused when their exes posted naked or sexual images online without their consent. One woman, Hollie Toups of Nederland, found dozens of photos of herself online and organized a class action suit against the website where they appeared.

oh, great ... a state appeals court upheld the First Amendment and voids a 2015 Texas ‘revenge porn’ law



FTFY https://t.co/K0P0X3mS4a — Scott Greenfield (@ScottGreenfield) April 19, 2018

"I was kind of numb at first and when I scrolled to the bottom it showed how many people had viewed it," Toups told the Tribune. "I saw that it was thousands and with all these comments. They were saying horrible things. That's when I got scared and I felt humiliated, knowing that as I was looking, so were thousands of other people."

The state law as currently written labels revenge porn a misdemeanor that carries possible jail time of as much as a year as well as a $4,000 fine.

If the state appeals, the case could wind up in front of the state Supreme Court.