Two female inmates at New York's Rikers Island jail who claimed they were raped repeatedly by a guard cannot sue on behalf of other inmates, a U.S. judge ruled on Tuesday.

U.S. District Judge Alvin Hellerstein said the women can only pursue their lawsuit against the city individually, rejecting their effort to bring the case as a class action.

RELATED: Corrections officer arrested for smuggling tobacco to Rikers inmates

The women filed the federal lawsuit in May, accusing the city of ignoring a "pervasive culture" of sexual abuse at the women's jail at the complex. They had sought to certify a class of all inmates who have been or will be assaulted by guards.

The women have maintained their anonymity and are referred to as Jane Doe 1 and 2 in the complaint.

A lawyer for the two women did not respond to a request for comment. A spokesman for the city's Law Department said the court made the correct decision.

"The claims that were allowed to proceed will be carefully reviewed by the city,” he said in an email.

RELATED:  DA: Bronx correction officers leave inmate deaf after assault on him

Rikers Island is one of the world's largest jail complexes, with 10 separate facilities housing about 10,000 inmates.

It has drawn intense scrutiny in recent years over safety and security issues, including allegations of corruption, inmate abuse and unchecked violence.

In June, the city agreed to implement reforms to resolve a separate class action brought by inmates at Rikers Island and backed by the U.S. Justice Department claiming that guards routinely used excessive force.

Mayor Bill de Blasio has said fixing Rikers is a top priority, and has installed a new correction commissioner and increased training for officers.

RELATED: NYC agrees to Rikers Island fixes in deal with U.S. Attorney Preet Bharara

Dozens of guards have been charged in recent years with various crimes, including smuggling contraband and assaulting inmates.