If you had to make a list of the worst possible things a person could do, taking the life of a child would probably be near the top. If you believe in Heaven and Hell, killing a child is almost certainly a first-class ticket straight to the latter. But according to a researcher from the University of California-Davis, in one scenario — one which repeated a few times in the 1700s — the opposite was true. People were killing innocent children in hopes of getting express entry through the Pearly Gates.

This was due to what is likely the worst loophole history has ever seen.

The story starts off the same in almost all the cases. The malfeasor, usually a woman, is suicidal. In the example the historian, Kathy Stuart, discussed with Ira Glass on This American Life, the murderer-to-be was Ava Litzelfelnerin, a young German or Austrian woman whose arranged marriage was a living nightmare. She moved far from the only home she knew to marry a man she met only moments prior, and whose mother ran her new household — and did not take kindly to Ava. Ava wanted to commit suicide, but she was Catholic. Killing herself would be murder, and murder is a sin which would doom her to an eternity of fire and brimstone. As bad as her mother-in-law was, that was worse.

The trick, Litzelfelnerin surmised, was to kill herself and confess away her sin after, thereby absolving her and allowing her soul to rise to Heaven. Of course, this doesn’t work that well, because it’s very hard (okay, impossible) for a dead person to go to Confession. Her first work-around was to poison herself with arsenic — take only enough to ensure her death, but not enough to get it done quickly. She could then wash away the sin after the bad act but before she died… except that timing such things is very difficult, and she couldn’t get it down right (and felt terrible in the process, because, you know, she was drinking arsenic). The next idea, though, worked — and was horrible.

Litzelfelnerin — and others before and after her — employed a concept called “suicide by proxy,” or basically, convincing someone to kill you for you. This way, you die without sin — you didn’t commit the murder — and you get to go to Heaven. But that, too, is difficult to pull off — you have to find someone to kill you, and that person is going to be incarcerated or executed and, by the way, will likely end up going to Hell. (Ideally, Litzelfelnerin wanted to avoid that latter part.) So instead, she just needed the government to sentence her to death. (The executioner would neither go to prison nor be doomed in a more cosmic sense.) To accomplish this, Litzelfelnerin simply needed to carry out a heinous crime.

Unfortunately, killing a child fit the bill perfectly. Her victim, being so young, was innocent, and would die but go to Heaven. The crime was so heinous, she would almost certainly be put to death. Before being put to death, she’d be asked if she wanted to confess to anything. She’d ask forgiveness for the murder, and in doing so, beat the system — almost. The only problem is that the Almighty is nobody’s fool, and the priest certainly wouldn’t allow for Litzelfelnerin or anyone else to get away with something like this. But Litzelfelnerin and others had a solution to this, too — they’d also ask for forgiveness for trying to trick the big man upstairs.

Germany, of course, didn’t want to incentivize the killing of children. So by the end of the 1700s, they changed the law, and removed the death penalty. The harm, however, had been done. According to Stuart’s paper (available here), approximately 300 suicides by proxy involving the murder of children took place before Germany stopped them.

Bonus fact : Pictured above is a gate to Glenarm Castle in Northern Ireland. The narrow, window-like openings are called “arrowslits,” but they also have another name — “loop holes” (two words). According to the Straight Dope, the term “loophole” comes from these slits: “Our derivation of ‘loophole’ as a way past a law is derived from this. The only openings in a seemingly impenetrable wall were these slits, which a child or small adult child could squeeze through. Thus, a loophole is a small opening, or ‘out,’ in a seemingly airtight law, which only the clever few can use.”

From the Archives: Pudding One Over: Another story about a loophole, but one involving pudding snacks, not murder.

Related: The Oxford Dictionary of English Etymology, handy for looking up the origins of words like “loophole.”