The Supreme Court ruled May 17 that those inmates deemed “sexually dangerous” can be held indefinitely — even after their prison terms are complete.

The court’s ruling in the United States v. Comstock upholds a 2006 law signed by President George W. Bush that authorized the civil commitment of sexually dangerous federal inmates. That law, formally known as the Adam Walsh Child Protection and Safety Act (named for the son of “America’s Most Wanted” host, John Walsh), was challenged by four men who have been kept behind bars for the potential risk they pose to society, though they were due to be released from prison more than two years ago. Prison officials say the men, who were each sentenced to terms ranging from three to eight years for possessing child pornography, are at risk of committing sexually violent acts or child molestation if released.

But the question before the court had little to do with sex offenders and more to do with states’ rights. The Court was charged with determining whether Congress overstepped its bounds with the 2006 law. It’s a gray area: While protecting the public’s health and safety is a concern typically left to the states, the federal government is ultimately responsible for the criminal justice system. In the 7-2 majority opinion, Justice Stephen Breyer asserted the federal government’s right to govern prisons. He wrote: “The Federal Government, as custodian of its prisoners, has the constitutional power to act in order to protect nearby (and other) communities from the danger such prisoners may pose.”

That was the legal quandary. But the real question for the rest of us who care more about predators lurking in our backyards and less about legal jargon, was what does this case mean for sex offenders? Does this ruling essentially allow the government to lock up sex offenders and throw away the key? Yes and no. The ruling only applies to those inmates who are both sexually dangerous and mentally ill. Which means in order to detain an inmate for longer than their original sentence, the government must prove the prisoner has both previously “engaged or attempted to engage in sexually violent conduct or child molestation” and that they suffer from a “serious mental illness, abnormality or disorder” and would have “serious difficulty in refraining from sexually violent conduct or child molestation if released.” Those prisoners who meet the criteria and are committed can request a regular reevaluation every six months, but there is essentially nothing that prohibits inmates from being continually denied release at each reevaluation.

Currently, fewer than 100 federal inmates nationwide have been identified for further detention after having served their sentences.

Interesting side note: The ruling is also a victory for President Obama’s Supreme Court nominee, Solicitor General Elena Kagan, who argued the case.

Also: In a separate case, Graham v. Florida, the Justices decided that sentencing a juvenile criminal to life in prison without parole is “cruel and unusual” punishment, particularly when the case does not involve a murder.