Wisconsin law bans sex with dead bodies, the state Supreme Court ruled Wednesday in reinstating charges against three men accused of digging up a corpse to have sex with it.

The court waded into the grisly case after lower court judges ruled nothing in state law banned necrophilia. Those decisions prompted public outrage in Wisconsin and on the Internet, where one blogger wrote: “Doing the dirty with the dead OK in Wisconsin.”

Not anymore, the court ruled in a 5-2 decision.