The Montgomery County school board, after lengthy emotional debate, decided last night to keep open the popular Takoma Park Junior High School, which has the highest minority enrollment of any intermediate school in the county.

The action came on a 4-to-2 vote shortly before midnight when the board reconsidered its decision, made earlier in the evening, to close the school in June 1985.

The previous board, ousted in the November election, had voted to close the school at the end of this academic year, citing declining enrollment and the high cost of needed renovation.

The initial decision last night to close the school, which members of the Takoma Park community view as a model of integration, drew immediate and angry reaction from the audience, composed mainly of Takoma Park residents.

"We told the previous board we would see them in federal court, and now Takoma Park tells this board we will see them in federal court," said Ruth Abbott, a longtime supporter of the school. She is the wife of Takoma Park Mayor Sammie Abbott, who has been one of the strongest critics of the closing decision.

The final motion to keep the school open was supported by board members James Cronin, Blair Ewing, Odessa Shannon and Robert Shoenberg. Shoenberg, who had originally voted to close it, supplied the winning margin. Members Marian Greenblatt and Marilyn Praisner voted no.

Community residents had waged a long battle with the school board over the closing decision. They argued that the school is a unifying force for the diverse and well-integrated community; unlike other school communities where racial imbalance is a prime concern, Takoma Park residents argued that they liked their school the way it was.

The school currently has a minority enrollment of 67 percent. The county-wide average is 25.4 percent.

Board President Ewing echoed the community's concern and warned that deciding to close the school would send the wrong message to the lower county area. The board's decisions for Takoma, he said, were "litmus tests" of how the board would deal with other schools in the area where minority enrollments have increased dramatically over the past decade.

"Will the board operate a single school system . . . or will there be one for the down-county area, for the black and the poor, and one for the schools north of the beltway?" asked Ewing.

Board member Greenblatt argued that the school was not needed because enrollment was declining in the area and that the board would set a bad precedent by overturning a previous decision to close it.

"I think this will be a very serious mistake," said Greenblatt, who then alluded to the strong pressure exerted by the Takoma Park community. "Everywhere else in this county communities have sacrificed . . . I think that closings have to be shared at each level."