A Staten Island middle school teacher who was removed from the classroom after allowing her eighth graders to use vulgar terms during a lesson on H.I.V. won her first battle against the city in federal court on Thursday, when a judge overruled a city effort to dismiss her case.

On Feb. 6, 2008, the teacher, Faith Kramer, a health and physical education teacher at Intermediate School 72 on Staten Island, taught a state-mandated lesson on the various behaviors that can transmit H.I.V./AIDS. According to legal documents filed with the case, she wrote down the polite words for sexual organs, sexual acts and bodily fluids on the board — and then asked her students to list any other terms they might know for those things.

In doing so, the judge ruled, she appeared to be following the spirit of a state syllabus that directed that students be encouraged to use sexual terms that they understood, so that they could relate those words to the more formal terminology. “If students use different terms,” the syllabus says, “make sure they understand the relationship between both sets of terms.”

Ms. Kramer argued that she did not ask students to write the resulting slang words, euphemisms and vulgarities in their notebooks, but some did. As a result, some of Ms. Kramer’s 30 students went home with neatly transcribed lists of off-color words for sexual acts and body parts, including two Yiddishisms for the male sexual organ. At least one parent called the school to complain, court documents state.