The 14-year-old student, also a ninth grader, told administrators and school police that while on the way to lunch Tuesday, two male students had pulled her into the classroom closet and sexually assaulted her.
District spokeswoman Felicia Ward said all three students agreed they had been in the closet, but gave differing accounts of what happened.
The boys told officials that the sexual activity had been consensual, and that the girl had entered the closet willingly and only later claimed she had been grabbed and assaulted, Ward said.
The girl did not require medical attention.
The boys have been suspended for five days pending the outcome of procedures to transfer them to disciplinary schools. They were questioned by police Tuesday night and released.
The students were not assigned to the substitute's classroom, and it was unclear whether the ninth graders were in the closet before the class began, Ward said.
Contact staff writer Martha Woodall at 215-854-2789 or martha.woodall@phillynews.com.