An Episcopal private school will move in September into an abandoned Montgomery County school building following an agreement reached yesterday between church and County Council leaders. The agreement stipulates that, with few exceptions, the private school will not accept student applicants who live in the building's neighborhood for the next 10 years.

The Montgomery County Council had scheduled debate yesterday on taking legal action to prevent Grace Episcopal Church from expanding its elementary school into the former Larchmont Elementary school building in Kensington. The school is in an area of the county that is the site of the county's major public school integration plan, and school and council leaders feared the school would attract students who did not want to participate in that integration.

Grace Episcopal leaders told the council yesterday they would not accept any new students in grades 1 through 6 from the predominantly black Rosemary Hills and predominantly white Chevy Chase areas, except for children of parishioners.

Church leaders also said no kindergarten-aged students from that area would be accepted for the next five years unless their parents belong to the church or they have siblings already in the school.

Council President David Scull, who has been the most vocal critic of County Executive Charles W. Gilchrist's decision to lease the school, thanked church and school leaders for reaching what he called a "resolution in which everyone wins."

The new enrollment restrictions, Scull added, may help the county's integration plan more than if the private school had relocated to another site.

Grace Episcopal officials have contended all along that their presence would not hurt the county's integration plan. Enrollment at their present school in Silver Spring, Grace Episcopal Day School, is about one-third minority.

Elizabeth Baily, the top lay official of Grace Episcopal, said yesterday the church would have preferred not to have any enrollment restrictions. "It's unfortunate that our public schools are so fragile that they council and school officials felt their stability could be jeopardized by our school," she said. "But we had no desire to ruffle the waters."

The area around Larchmont first attracted attention after the school board voted last March to revise a 6-year-old busing plan there that had been terminated by a previous board.

A majority of parents of kindergarten-aged children from the Chevy Chase Elementary area said after the board's March vote that they would enroll their children in private school rather than send them to Rosemary Hills.

Yesterday, some parents of students currently enrolled in Grace Episcopal Day expressed anger at the new restrictions. "Who do they think they are, telling a private school who they can or cannot enroll?" asked Mary Bourgoin.

But Kensington residents who lived near the Larchmont site welcomed the decision. "It's very satisfactory," said Harold Wirth, one of the leading supporters. Residents had complained that the building, which had been vacant for three years, was an ugly skeleton that encouraged neighborhood vandalism.

Grace Episcopal will pay the county $30,000 a year in rent.