Several fraternities and sororities sued Harvard University on Monday over its restrictions on students joining off-campus single-sex social groups, saying the rule aimed at combating sexism is itself sexist.

Harvard created a rule in spring 2016 that punishes students if they are members of fraternities, sororities, and final clubs — a type of social group unique to Harvard — unless the organizations go coed.

The lawsuits filed Monday — one in federal court and one in state court — say the rule disproportionately hurts women by targeting all-female clubs created to counter Harvard’s male-dominated history. They also say the rule is rooted in sexism against men, whose fraternities and private clubs have been the subject of criticism by university officials over alleged sexist behavior.

“Unrecognized single-sex social organizations are the only kind of organizations that Harvard punishes students for joining,” one of the lawsuits said. “A Harvard undergraduate could join the American Nazi party, or create an off-campus undergraduate chapter of the Ku Klux Klan, without running afoul” of school rules.

The Sigma Alpha Epsilon and Sigma Chi fraternities, the Kappa Kappa Gamma and Kappa Alpha Theta sororities, and three anonymous Harvard students filed a lawsuit against Harvard in federal court. The Alpha Phi sorority and a local chapter, along with a management corporation for the Delta Gamma sorority, sued in Massachusetts state court.

“Harvard should get out of the business of trying to dictate who students spend their time with off campus,” R. Stanton Jones, a lawyer for the plaintiffs in the federal case, said in a statement.

The rule was first imposed by the dean of Harvard College, Rakesh Khurana, in spring 2016. The announcement followed a university report that cited a disproportionate percentage of sexual assaults were linked to final clubs and frats, partly because they host a lot of booze-filled parties. A group of students had filed a Title IX complaint against Harvard College in 2014 arguing that assaults at final clubs were not being addressed. Khurana privately told students that the Title IX complaint was one reason Harvard needed to do away with all-male clubs, according to the federal suit.

In addition to final clubs, it has been expanded to include single-sex fraternities and sororities and all-male and all-female singing groups. The Hasty Pudding Club, a renowned theatrical group, cast its first women this year to comply with the policy, but it came following years of controversy about whether it would include women. Actor Mila Kunis said earlier this year she would not accept an award from the group if it did not add women.

Undergraduate members of single-sex social clubs are barred from holding leadership positions in on-campus student groups and on athletic teams, and will not be endorsed by the university for coveted fellowships like the Rhodes Scholarship.

Rebecca Ramos, who graduated from Harvard in 2017 and was the Delta Gamma chapter president, told BuzzFeed News that administrators started asking undergrads in fellowship interviews and law admissions interviews if they were involved in single-sex groups or if they agreed with the new policy against such clubs. “That has created a culture of fear,” Ramos said.