Two years after the Center School vacated the building it once shared with P.S. 199 to alleviate overcrowding, the Upper West Side middle school is being told to give up some classroom space again.

Administrators from the Center School and P.S. 9, which share a public school building at 100 W. 84 Street, agreed last week that the Center School would give one of its 11 classrooms to P.S. 9 in September. Department of Education officials said the building council made the decision in response to an enrollment increase at P.S. 9. Administrators from P.S. 9 were not available to comment.

But some Center School community members say the DOE is sacrificing their school rather than add new school seats in District 3, where popular schools such as P.S. 9 have seen enrollments swell. They also view it as a continuation of a heated controversy between the school and the DOE over the school’s relocation.

In 2008, the DOE told the Center School to leave the building it shared with P.S. 199 for more than 26 years to accommodate P.S.199’s growing class sizes. Parents and staff fought a pitched battle against the move. The actress Cynthia Nixon, a Center School parent, even accused the DOE during a public hearing of promoting racial segregation and classism. Roughly one-third of students at the Center School are African-American or Hispanic.

Ultimately, the fight was unsuccessful, and since moving into the PS 9 building in 2009, crowding has been an ongoing problem for the selective middle school and its 224 students. Even with 11 classrooms, the Center School sometimes held electives, called “minis,” and literature seminars outdoors or in the school’s hallways and stairwells, according to Elaine Schwartz, the principal.

When one teacher, Rebecca Montville, asked some of her 14 literature students to act out scenes from “Flowers for Algernon” during class last year, she and the audience huddled in the back of a walk-in closet usually shared by the guidance counselor and speech therapist. The actors maneuvered around an office desk that furnished the front-half of the make-shift classroom.

“They make it work, but it’s not optimal,” Montville said of her students, who are in fifth through eighth grades. “It will be to the hallways or to the closet. It takes away from class time because one of the first things you have to do when you get in the room is figure out how we’re all going to fit.”

Class sizes at the Center School range from a dozen students to nearly 50 for a theater class, Schwartz said, and the smaller classes are usually the ones sent out into the hallways when there are space constraints, which happens for the majority of class periods. She said the loss of one classroom could further strain the students and teachers.

“We have classes in the stairwell, classes in the back hallway, sometimes on the auditorium stage — anywhere we can find space,” she said.

In May, the DOE pushed the school to cede two classrooms to P.S. 9, which last year had 600 students.

“We objected strongly to that,” Schwartz said. “I didn’t want bigger classes in younger grades, or more classes in the halls.”

The agreement last week gives one classroom to P.S. 9 and is assured until 2015, Schwartz said.

P.S. 9 administrators report that a 65 percent one-year rise in the number of zoned families registering for kindergarten means that the school will offer another kindergarten class this fall, but it is losing its two gifted kindergarten classes.

When asked if she would like to move the school again to a building with more classrooms, Schwartz responded, “No. Not unless you’re building us our own building.”

Critics have long said that the city has inadequately planned for growing populations across the city, and Schwartz said no one in the DOE has formally raised the possibility of creating a school building solely for the Center School.

“I look at this as a major problem for the whole of District 3,” she said. “There’s just not enough spaces for children to put their books down.”