A 17-year-old girl who paid a man to beat her in the hopes of terminating her pregnancy has been released following a judge's ruling that her actions were legal based on the state's abortion laws.

Judge Larry Steele said that while the girl's actions were "shocking and crude," they were, nonetheless, legal under the state's current definition of abortion. The ruling cites Utah code in defining abortion as "the intentional termination or attempted termination of human pregnancy … and includes any and all procedures undertaken to kill a live unborn child and includes all procedures undertaken to produce a miscarriage."

The 8th District juvenile-court judge issued the ruling last week. He said this incident, in which the pregnant girl told police she had taken the actions because she wanted to have a miscarriage, fits that definition of the law. The girl is then protected from being held criminally liable.

The teen initially entered a no-contest plea to the charge of solicitation of murder but is now protected from criminal action based on the judge's decision.

Ultimately, the judge said his hands were tied because of the way the statute was written.

"Simply put, this is not a choice the court has to make," the ruling states. "The Utah State Legislature has spoken on the issue of abortion and, for policy reasons, chose not to hold a woman liable in situations such as these."

Rep. Carl Wimmer, R-Herriman, said the judge "stretched" the law, and Wimmer is already taking action to amend the statute. Wimmer said he was "absolutely outraged" at the decision and is already planning a bill that will "close that loophole for good."

"I have questions on whether there was really a loophole there in the first place, but I can guarantee that that loophole will be closed in the next legislative session," Wimmer said.

The lawmaker said he is working with legislative attorneys to ensure the bill will prevent "disgusting situations" like this in the future.

"We're going to make sure that that never happens again," Wimmer said. "Abortion and right to life is the top issue for me, and it is something I feel very passionate about."

Prosecutors had argued that the woman should be charged because she was trying to solicit the felony act of murder, but the judge refuted the position. "The problem with this argument is that the abortion statute specifically states that a woman cannot be criminally liable for soliciting the abortion of her unborn child," Steele wrote.

While the judge said there was some basis to the argument that the actions taken didn't fit the definition of the statute because it requires the abortion to be carried out by licensed medical personnel, that doesn't mean the attempted termination was murder, it was just an illegal abortion, he wrote.

In May of this year, the pregnant teen approached Arron Nathaneal Harrison, 21, on the street and asked him to beat her in the hopes that the beating would cause her to miscarry. The girl told police at the time that her boyfriend had told her he would end their relationship if she didn't get an abortion.

Investigators believe the girl paid Harrison $150 to beat her, which included punching her five times in the stomach, slapping her and biting her neck in an attempt to make the incident look like a random assault, police said. Harrison later pleaded guilty to attempted murder and is set to be sentenced Oct. 27.

Though the girl was badly beaten at the time, both she and the fetus survived, and the baby was born in August. Court records indicate the baby would most likely be put into state custody.

Elizabeth Solis, spokeswoman for the Department of Child and Family Services, said that while she couldn't comment on this specific case, decisions for placement are made by her department and the court and are based on home situations and child safety.

"We always try to find placement that works in the child's best interest," Solis said. "We do kinship placements, if possible, and just try and look at the child's needs."