The Lower Merion School District has agreed to purchase a 19th century Beaux Arts mansion to build a new middle school, which may indicate it is moving ahead with plans to take 6.9 acres of the recently opened Stoneleigh garden to use as athletic fields.

The school board unanimously agreed to enter a formal agreement to purchase the 21.83-acre site from the Foundation for Islamic Education for $12 million contingent on a number of conditions, including that the district find nearby space for outdoor activities.

District spokeswoman Amy Buckman said in an email, "The search for that space is ongoing, and no options have been taken 'off the table.'"

Lower Merion Township commissioners have already helped with another condition, killing a plan to upgrade the mansion's historic resource classification from Class 2 to Class 1, which indicates greater historic value and offers more protection under Lower Merion's historic preservation ordinance. The district had said it wouldn't purchase the property with the upgraded classification.

But the issue of where to put athletic fields has roiled the Main Line township, where residents have come out in force to protect Stoneleigh, once the family home of John and Chara Haas, who deeded the property to Natural Lands for a public garden that took two years to create and that opened on Mother's Day.

The district said at the time it might consider taking the entire  garden through eminent domain, but has backed off that plan. Natural Lands, which added 10,000 plants and 350 trees to the site, said the entire property is protected from development in perpetuity by conservation easements.

The extra ground is needed because the Islamic Foundation site is too steep for athletic fields.

Many residents and conservationists had condemned the school district's plan to take Stoneleigh, which they said is not only illegal but would ruin the aesthetics of the curated garden.

Even the Pennsylvania legislature jumped into action to help the garden, last month quickly voting for a law that would prevent government entities such as school districts from seizing land that is under easement without court approval.

That the district is moving ahead despite such opposition reflects the urgency of finding a solution to overcrowding in its middle and elementary schools while facing a lack of available large open spaces in the affluent suburb. Attempts to acquire two other potential sites, St. Charles Borromeo Seminary and Friends' Central School, did not pan out.

The district expects to top out at 9,300 students, about a 10 percent increase over the current enrollment. The district's pupil population has grown more than 20 percent in the last 10 years.

Administrators previously said they hoped to have an expansion plan – involving either a new school or adding capacity to several existing ones – in place by the end of last school year. Officials say they hope to have a new fifth- through eighth-grade middle school open by the fall of 2022.

According to the Lower Merion Conservancy, the Planning Commission's recommendation that the Clothier Estate farm — now the site of the Islamic foundation — be upgraded to a Class 1 designation had been relatively assured of approval until the district signaled that if that happened, it would exercise eminent domain over all of  Stoneleigh to build the middle school and playing fields. The board's 7-7 vote last month killed the recommendation.

The former farm was once owned by the Clothier family of the old Strawbridge & Clothier department store. Its white stucco mansion was designed by architect Horace Trumbauer, who also designed the Philadelphia Museum of Art and the Central Library of the Free Library of Philadelphia.