Expectant mothers shouldn’t expect any special treatment when they’re accused of violent crimes, a panel of judges said Friday.

The appellate panel said a judge in Burlington County was wrong to release a 20-year-old woman from custody in June just because she was eight weeks pregnant.

Imani Williams and an accomplice were accused of brutally beating a woman on the street and taking money for her purse.

Williams has a long criminal history dating back to her teens, is facing charges in other crimes, and has failed to appear for court six times in the last two years, officials said.

Under the bail reform law that went into effect in January, that’s the kind of profile that should lead judges to rule against releasing the defendant before trial.

But the judge in this case said the state’s Public Safety Assessment point system didn’t take into account the woman’s pregnancy or her prenatal medical needs.

The judge warned Williams that her pregnancy was “a card” she could “play once.” He ordered her to report in person every week and placed her under a 5 p.m. to 6 a.m. curfew, allowing her to leave home only to go to work or see a doctor.

Prosecutors appealed the decision and the three-judge panel on Friday ordered a new detention hearing, calling the judge’s reasoning “speculative, unsupported by any facts in the record, and therefore, irrelevant.”

Their decision says that the law requires county jails to provide medical care, including for pregnant inmates.

“We do not suggest that there will never be circumstances” where it will make sense to release a pregnant defendant, the decision adds.

“Here, however, there is no indication that defendant’s pregnancy was classified as high risk or presented any unusual medical complications requiring specialized treatment. Nor is there any indication that the jail was unable to provide appropriate prenatal medical care to defendant.”

Until this year, bail laws did not allow judges to consider a defendant’s potential risk to the community — allowing them to be released if they could post bail. On the other hand, many low-risk defendants waited months or years in jail because they couldn’t afford bail.