That worries the American Civil Liberties Union, which this year filed complaints with the Education Department against four Florida school districts, accusing them of violations of federal civil rights law and of using “overly broad stereotypes” to justify separating girls and boys into different classrooms. The A.C.L.U. also filed a complaint in Austin, Tex., against two new single-sex middle schools, and has pending complaints in Idaho and Wisconsin and a nearly two-decade-old complaint in New York. Lawsuits in Louisiana and West Virginia have resulted in single-sex classes there reverting to coeducation.

Advocates of single-sex classes often cite the struggles of boys, who persistently lag behind girls in national tests of reading comprehension and are much more likely to face disciplinary problems and drop out of school. Educators also argue that girls underperform in science when compared with boys and benefit from being with other girls. And school officials say that children can be easily distracted by the opposite sex in the classroom.

This week, in response to the A.C.L.U. complaints and the growth in single-gender classrooms, the Obama administration is issuing guidance for school districts.

Schools may set up such classes if they can provide evidence that the structure will improve academics or discipline in a way that coeducational measures cannot. Students must have a coeducational alternative, and families must volunteer to place their children in all-boys or all-girls classes.

But the guidance says that “evidence of general biological differences is not sufficient to allow teachers to select different teaching methods or strategies for boys and girls.”

“I am very concerned that schools could base educational offerings on stereotypes,” Catherine E. Lhamon, assistant secretary for civil rights, said in an email. “No school should be teaching students to live down to diminished expectations for who they can be.”