People often joke that marriage is like a prison, but one Texas judge apparently believes that the two are actually interchangeable.

Local ABC affiliate KLTV reported last week that Smith County Judge Randall Rogers sentenced Josten Bundy, 21, to marry his girlfriend, Elizabeth Jaynes, 19, within 30 days of his hearing in order to resolve an assault charge for punching her ex-boyfriend after the ex said “disrespectful things.”

“Is she worth it?” Rogers asked Bundy during the court hearing.

Then, upon finding out they weren’t married yet: “You know, as a part of my probation, you’re going to have to marry her…within 30 days?”

Rogers also ordered Bundy to write down Bible verses and undergo counseling as part of his probation. According to KLTV, Bundy was offered a choice between a more conventional 15-day jail sentence or marriage. He told the station that he would have actually preferred the jail time if the judge had allowed him to notify his employer but, when Rogers refused, he accepted the alternative sentence out of fear of losing his job.

He and Jaynes had discussed marriage in the past but neither planned for it to happen under court order.

“It just felt like we weren't going to be able to have the wedding we wanted,” Jaynes said. “It was just going to be kind of pieced together; I didn't even have a white dress.”

Bundy, who would have donned “a black tux with some yellow under it” in honor of the Pittsburgh Steelers, said that his father and sisters couldn’t even make it to the courthouse wedding on such short notice.

According to public records obtained by The Daily Beast, the couple was married on July 20, 18 days after the hearing. The Smith County Courthouse told The Daily Beast that Judge Rogers cannot comment on the case as legal action is still pending.

This isn’t the first time that a local judge has tried to play matchmaker. In 2012, Judge John Hurley in Broward County, Florida, ordered Joseph Bray, a man facing a domestic violence charge, to bring home flowers to his wife, take her to Red Lobster, and go bowling. The domestic dispute began when Bray did not celebrate his wife’s birthday, so Hurley threw a belated card into the mix, too.

“Flowers, birthday card, Red Lobster, bowling,” the judge summarized.

Hurley said that he only ordered a dinner date and marriage counseling because it was “a minor incident” and because the wife was no longer afraid of Bray, who had pushed her onto a couch, put his hand on her neck, and held up his fist as if he were about to punch her.

“The court would not normally do that if the court felt there was some violence but this is very, very minor and the court felt that that was a better resolution than other alternatives,” Hurley said at the time.

But Judge Randall Roger’s recent wedding sentence is a bit more serious than an order of Cheddar Bay Biscuits.

Since the story broke, legal experts have speculated that ordering a man to get married as an alternative to jail time is likely illegal. Constitutional law attorney Blake Bailey told KLTV the sentence was “way out of left field” and compared it to “the old days of shotgun weddings.” The father of the bride, Kenneth Jaynes, added that he had trouble finding a lawyer who would even believe that the case was real.

“[T]hey told me someone was trying to pull my leg,” Jaynes said.

Alternative sentencing is not uncommon for first-time and low-risk offenders. But a sentence of marriage is highly unusual.

A Painesville, Ohio, judge named Michael Cicconetti is the king of alternative sentencing, often making headlines for his creative punishments. He once allowed a woman who had abandoned 35 kittens to spend a night in the woods alone without water or food in lieu of a prison sentence.

As a matter of professional ethics, Judge Cicconetti could not comment directly on Judge Rogers’s recent decision. He did, however, explain his own criteria for alternative sentences, which he sometimes offers if they can be properly supervised.

“First, [the defendant] has to show some remorse,” Cicconetti told The Daily Beast. “Usually, they have to be somewhat young and impressionable. Third, it usually has to be a first offense in the area. Then, the punishment has to fit the crime, so it has to be something that’s relevant to the offense itself.”

But the “real litmus test,” Cicconetti said, is whether or not he would perform the sentence himself if given the choice between jail time and an offered alternative.

“You have to be careful with these,” he added.

So far, some of the only recent examples of using marriage as an alternative sentence can be found in the United Arab Emirates (UAE), where premarital sex is illegal and punishable by flogging. In 2013, a UAE judge ordered a couple who had a child out of wedlock to “go get married.” Courts in the UAE capital of Abu Dhabi are considering the marriage alternative as a general option for reducing their premarital sex caseloads.

Some in the UAE, however, are understandably concerned about the long-term prospects of marriages that begin with court orders.

Abu Dhabi attorney Ali Al Qareiny told government-owned newspaper The National that the vast majority of women “immediately agree to a marriage,” but that most of these marriages don’t work out in the end.

“Most cases that I have seen, the bride is not happy,” he said. “She doesn’t even have a wedding. And probably six months later she is divorced. The man married her to escape the penalty.”