It took 11 long years, but it looks like a majority of states are finally committing to addressing the problem of prison rape.

As of May 20, a majority of states plan to comply with the prison rape rules

Back in 2003, Congress unanimously passed the Prison Rape Elimination Act — a bill to address a problem that, at the time, was little understood. But after that… nothing much seemed to happen for a while.

The federal government spent six years studying the problem — discovering that prison rape was shockingly widespread — and then took another three years writing rules to prevent prison rape that it hoped states might adopt.

The pivotal deadline, at last, came on May 15 of this year — the day that states had to either adopt the new regulations or promise to enact them. And for a while it looked like few states would actually do anything. Texas, for one, had already flatly refused to adopt the new rules. Other states griped that they were being asked to move too quickly. Things didn't look good.

In the end, though, the results were surprising: As of May 20, a majority of states have told the federal government they'll either comply with the prison-rape regulations or work toward compliance in the future, Vox has learned. That's according to Just Detention International, an advocacy group working with the government on the issue. (The Department of Justice has not released final numbers and has not yet responded for comment.)

The country is still a long way from curtailing the problem of prison rape. But as of this week a majority of states have agreed to three important things: prison rape is a serious problem; it's the responsibility of states and the federal government to fix it; and they can be held accountable for not doing what is in their power to do.

The prison rape problem

One of the longtime difficulties in talking about prison rape in the United States was that, historically, there hasn't been enough data to understand the problem. Back in 2003, the head of the American State Correctional Association could claim that "sexual assault in prison is greatly exaggerated" — and while Congress didn't find his claim persuasive, no one could offer numbers to rebut him.

4% of state and federal inmates reported being sexually victimized in 2011

Only after Congress passed the Prison Rape Elimination Act in 2003 — which was intended to solve the problem of prison rape in state and federal prisons — did the government start collecting data that depicted how big the problem was to begin with.

The most recent federal survey found that 4 percent of all state and federal prison inmates reported being sexually victimized by another inmate or a staff member in 2011 — which comes out to over 87,000 victims of sexual assault in a single year.

Meanwhile, 2.2 percent of prison inmates and 1.7 percent of jail inmates reported that they were the victims of either a nonconsensual sexual act with another inmate, or unwanted sexual content with a staff member, in 2011. (For comparison, according to the FBI, the rate of "forcible rape" against all women in the United States was about .05 percent.)

The federal government's data shows that a little under half of all sexual assault was the result of abuse by staff. That's disturbing in that it shows widespread abuse of power in prisons — but it also means it might be easier for the government to fix the problem. After all, prison administrators have much more control over their own staff than they do over inmates themselves.

Why it took so long to come up with regulations

The Prison Rape Elimination Act of 2003 didn't put specific requirements on prisons. Instead, it created a National Prison Rape Elimination Commission to figure out what sort of policies on prison rape prisons should implement — then told the federal government to turn those policies into regulations.

the rules to prevent prison rape moved forward at a glacial pace

The bill also made 5 percent of federal funding for state prisons conditional on whether they implemented onto those regulations or not.

The process sounds slow. In practice, it was glacial. The commission didn't even publish its recommendations until June 2009 — six years and one presidential administration after the law was passed.

Part of this was just bureaucratic slowness and foot-dragging. But part of it was that the commission had a difficult task. No one even knew how big a problem prison rape was in 2003 — let alone how to solve it. So the commission had to gather testimony from survivors, prison administrators and experts before publishing their report; the federal government then gathered input from state prison officials when formulating regulations.

The new policies to address prison rape

The commission had a few broad suggestions that formed the basis of the new regulations:

1) Inmate education. The new regulations require all prisons and jails to tell inmates when they arrive that they have a right to be free of sexual abuse, and let them know how they can report it if something does happen.

'People used to joke about sexual abuse in the yard — they don't anymore'

According to Jesse Lerner-Kinglake of Just Detention International, prison administrators recognize the value of this once they start doing it.

Prisons have also found that inmates themselves can be the best educators. One peer educator who led a series of workshops in California said, "People used to joke about sexual abuse in the yard. They don't do that anymore." Another told advocates, "It meant a lot more when I was telling them they had a right to be free from sexual abuse."

2) Support services. The proposed new principle for support services, according to Lerner-Kinglake, is that "the level of standards in prison" for victim services "should be the same as the level of standards in the community."

The easiest way to make sure that survivors in prison are getting cared for just as well as anyone else is to have the same organization responsible for both. That entails having prisons partner with rape crisis centers or similar organizations in their communities, so crisis center staffers can come into the prisons and work with inmates.

3) Limits on cross-gender patdowns and viewing. When the commission looked into some of the worst prisons for sexual abuse — including several Michigan women's prisons that were sued for sexual abuse in the 1990s — they found that the prisons required guards to pat down a certain number of inmates every day.

Because most prison guards have historically been men, this resulted in a lot of cross-gender physical contact, creating plenty of opportunities for abuse. In recent years, as the share of female prison guards has increased, there's also more risk of cross-gender touching for male prisoners.

The regulations also set strict limits on when a guard can see a prisoner of the opposite sex naked at all — which some prison administrators worry is going to be hard to do without discriminating against female guards in hiring.

4) Special protections for vulnerable populations — especially LGBT inmates. Lerner-Kinglake paints this as a simple matter of common sense. One of the members of a Just Detention International advisory group, he says, is "a gay man who was raped by his cellmate…who had a history of raping gay inmates. It should have been clear to staff that they should not have been housed together."

Transgender inmates can also be especially vulnerable in single-sex facilities — the commission's report makes it very clear that guards shouldn't be in the business of examining the genitals of transgender inmates unless they genuinely don't know the inmate's physical sex.

Why states took so long to comply

The final federal regulations were published in June 2012. At that point, states could figure out whether or not they'd be able to implement those regulations — and they had until May 15, 2014 to say whether they were planning on doing so. (Alternatively, they could reject the regulations and see a cut in federal funding.)

Until recently, it looked like many states wouldn't meet the may 15 deadline

Until very recently, it looked like many states weren't going to be ready to meet the May 15 deadline — even just to promise the feds that they'd be working to put the regulations in place.

One reason: the regulations required states to start auditing their prisons starting in August 2013, and to audit a third of all prisons each year — but the government didn't finish developing auditing forms auditors until this past April. (It's not clear how many prisons have been audited so far — only one facility, a juvenile detention center in Idaho, has published its audit results.)

Many states, for their part, felt that they were being ordered to approve regulations before they had any idea how close their prisons were to complying. In Texas, Governor Rick Perry complained that the Department of Justice hadn't listened to the states — despite the fact that his own state's department of criminal justice had worked very closely with the DOJ to develop the regulations. (Gov. Perry wrote a new letter last week, which reiterated that his state wouldn't be complying, but dropped the confrontational tone.)

Ultimately, though, states ended up complying. Today, Just Detention International reported that a majority of states have either certified that they're already complying, or promised to comply in future.

It's still not clear exactly how many states fall into each of those categories. But even if most states are just making the promise, that means that the question of how to stop prison rape is no longer simply academic. It's now something that states will be expected to know, and be working to stop.

Correction: This article originally attributed a comment advocates had received from a peer inmate educator as being from a prison administrator. The quote is now properly attributed.