WASHINGTON — Women who were once F.B.I. recruits sued the bureau on Wednesday, accusing it of running a “good-old-boy network” at its training academy that discriminates against women, in some cases because of race and disabilities in addition to gender, and sets them up to fail.

Male instructors at the academy in Quantico, Va., exposed the women beginning in 2015 to a hostile work environment, sexual harassment and inappropriate jokes, according to the lawsuit. One woman said that an instructor referred to an African-American female trainee as “spaghetti head,” a reference to her braids. The woman also said training agents made repeated sexual advances.

In particular, the lawsuit takes aim at the tactical training that plays out Hogan’s Alley, the academy’s mock town where hired actors play terrorists and criminals. Trainees practice making dangerous arrests where they use weapons. Many of the female agent recruits were kicked out of the academy during this phase more quickly and more often than men were.

[Women said F.B.I. training instructors punished them, not men, for mistakes.]

“The real purpose of the suit is to change the culture of the F.B.I.,” said David J. Shaffer, the lawyer for the women.