An estimated 500 public schools across the country now offer some all-boy and all-girl classrooms.

Robin Gilbert didn’t set out to confront gender stereotypes when she split up the boys and girls at her elementary school in rural southwestern Idaho.

But that’s exactly what happened, with her Middleton Heights Elementary now among dozens of public schools nationwide being targeted by the American Civil Liberties Union in a bitter struggle over whether single-sex education should be continued. Under pressure, same-sex classes have been dropped at schools from Missouri to Louisiana.

“It doesn’t frustrate me,” Gilbert said of the criticism, “but it makes the work harder.”

While Gilbert’s school is believed to be the only one in Idaho offering same-sex classes, the movement is widespread in states like South Carolina, which has more than 100 schools that offer some form of a single-gender program.

Single-sex education began proliferating after the U.S. Education Department relaxed restrictions in 2006. With research showing boys, particularly minority boys, are graduating at lower rates than girls and faring worse on tests, plenty of schools were paying attention.

In 2002, only about a dozen public schools were separating the sexes, according to the National Association for Single Sex Public Education, an advocacy group. Now, an estimated 500 public schools across the country offer some all-boy and all-girl classrooms.

Proponents argue the separation allows for a tailored instruction and cuts down on gender-driven distractions among boys and girls, such as flirting. But critics decry the movement as promoting harmful gender stereotypes and depriving kids of equal educational opportunities. The ACLU claims many schools offer the classes in a way that conflicts with the U.S. Constitution and Title IX, a federal law banning sex discrimination in education. Researchers also have weighed in.

Diane F. Halpern, a former president of the American Psychological Association, co-authored a review of studies last fall in the journal Science that found research doesn’t support the benefits of single-sex education. Additionally, there are lots of problems whenever you segregate people into groups, Halpern said.