In Park Slope, Brooklyn, where popular elementary schools inspire cultish devotion, P.S. 282 has long been an outlier, struggling to attract families who live nearby. But in recent years, thanks in part to a new principal, the school has been on the rise — and now a new city plan could help it grow.

The Department of Education has proposed doing away with P.S. 282’s middle school grades — and replacing them with roughly 300 more students in the elementary school. The proposal would boost elementary school enrollment by around 50 percent over the next three years, while eliminating grades six through eight over the same period.

Education officials said the plan would help meet increased demand for elementary school seats in one of the city’s fasting growing districts. Meanwhile, a new middle school in Dumbo and another in development in Prospect Heights could help offset the loss of middle school seats.

“Our goal is to provide a strong learning environment and expanded resources to all students, and this proposal will help increase the number of elementary seats in District 13,” said Department of Education spokesman Michael Aciman.

P.S. 282 has been in flux since Principal Magalie Alexis, who had a contentious relationship with parents and staff, resigned in 2014. She was replaced by Rashan Hoke, a longtime teacher at Inwood’s P.S. 5.

“It’s like night and day,” said PTO co-president Andrew Marshall, whose daughter is now a fifth-grader at the school. “He’s firm, he’s fair. He looks at the parents as equals.”

Unlike P.S. 321, where approximately 75 percent of students are white, P.S. 282 serves a more diverse population. Last year, it was 59 percent black, 25 percent Hispanic, 9 percent white and 3 percent Asian.

The percentage of students who passed state tests last spring was up from the year prior. Just over 44 percent passed English, compared to a citywide average of 38 percent; and around 34 percent passed math, just under the citywide average of 36 percent.

“We’ve got a strong foundation for growth,” Stephen Hamill, chair of the School Leadership Team, wrote in an email. “But we want to make sure that this proposal will be good for our families and we retain a strong pipeline to excellent middle schools.”

A meeting will be held at the school to discuss the plan on Monday and public hearings will follow. The proposal is expected to be voted on by the Panel for Educational Policy on Dec. 21.

Principal Hoke said in a statement that he welcomes the chance to discuss details of the plan. “I look forward to the opportunity to engage our school community as we continue to consider our options,” he said.