A Utah woman was dealt a setback in her fight against criminal charges for being seen topless by her stepchildren in her own home when a judge upheld the state’s lewdness law on Tuesday.

Tilli Buchanan, who could face prison and be forced to register as a sex offender for 10 years if convicted, challenged the lewdness statute as unconstitutional on the grounds that it discriminates against women by making it illegal to show their breasts.

UTAH STEPMOM WAS TOPLESS IN FRONT OF STEPKIDS INSIDE HOME, NOT FACING CHARGES, AUTHORITIES SAY

Judge Kara Pettit upheld the law after prosecutors argued that lewdness in American society is commonly understood to include women’s breasts, the Salt Lake Tribune reported.

Buchanan could face jail time and be forced to register as a sex offender if convicted. (Fox13 Salt Lake City KSTU)

Buchanan and the American Civil Liberties Union of Utah had said the law involving a child is unfair because it treats men and women differently for baring their chests.

They made their case by pointing to a court ruling that overturned a topless ban in Colorado – a campaign known as the “Free the Nipple” movement.

But Pettit said the ruling in Fort Collins, Colo., was different from the lewdness involving a child law in Buchanan’s case, FOX13 Salt Lake City reported.

It wasn’t immediately clear whether Buchanan would appeal the ruling. If she does not, her misdemeanor charges would move toward trial.

COLORADO CITY ENDS TOPLESS BAN AFTER SPENDING $300G DEFENDING IT IN COURT

Buchanan was charged after she and her husband took off their shirts to keep their clothes from getting dirty while they hung drywall in their garage in a Salt Lake City suburb in late 2017 or early 2018. His three children, ages 9 through 13, then walked in and saw the couple topless.

The children’s mother reported the incident to child welfare officials working on a separate investigation involving the kids. Her husband was not charged.

Buchanan “explained she considers herself a feminist and wanted to make a point that everybody should be fine with walking around their house or elsewhere with skin showing,” her lawyers said in court documents.

CLICK HERE FOR THE FOX NEWS APP

Police alleged Buchanan removed her shirt and bra in front of the children while “under the influence of alcohol.”

The Associated Press contributed to this report.