ON THURSDAY, the Justice Department released the results of a 2008 survey of former state inmates. One in 10 reported being sexually abused while incarcerated. Prison rape at any frequency is a national disgrace; at that rate, it’s also an epidemic.

Separately on Thursday, the Justice Department also announced — finally — what it will do about this epidemic. Sometimes good things can take time, and this is a very good thing that took a very long time.

Congress passed the Prison Rape Elimination Act (PREA) in 2003 with support so bipartisan that ideological opposites such as Sen. Jeff Sessions (R-Ala.) and the late Sen. Edward M. Kennedy (D-Mass.) co-sponsored it. In accordance with the law, a commission spent six years investigating and formulating recommendations for new rules. Then the Justice Department slow-walked the rule-writing, repeating much of the commission’s labor. When the department finally proposed draft rules, they were too weak.

There’s no recompense for the suffering of victims who had to wait. But the final rules Justice announced Thursday are stronger. They require independent audits of facilities every three years, ban cross-gender strip-searches, prescribe separating probable victims from dangerous inmates, require three internal channels to report abuse and demand monitoring of inmates who do so. Critically, the administration also clarified that PREA applies to prisons run by private companies and to immigration detention facilities under the Department of Homeland Security.

Justice’s standards aren’t perfect. For example, though juvenile prisoners will be kept almost entirely separate from adults, Justice didn’t try to restrict placing juveniles in adult facilities in the first place. Vague wording on how prison officials can prevent retaliation against inmates who report abuse could result in lax policies that do not do enough to combat retribution.

Still, the greatest risk now is that states and localities won’t fully adopt Justice’s standards, which are binding only at federal facilities. Homeland Security, too, must write its own rules. It has only 120 days to do so, suggesting the agency will follow Justice’s lead, as it should.

Even assuming widespread adoption, Justice’s work will not be finished. It is not yet clear how the government will measure the rules’ success — reported instances of prison rape might even go up as fewer inmates fear retaliation. New triennial audits should produce massive amounts of new information that Justice and non-governmental advocates will have to review, with an eye to what else may be needed to end the epidemic.