The Satmar community has purchased the former Skinners site in Stamford Hill and will turn it into a girls' school.
Developers Berkeley Homes, who purchased the site three years ago, planned to knock down the school and build luxury homes but in March Hackney's planning sub-committee voted against the proposals.
Members of the Belz, Satmar and Lubavitch communities launched
a campaign, supported by Chief Rabbi Lord Sacks and Board of Deputies' president Vivian Wineman, against the housing proposal. They wanted the site to be reserved for educational use.
Last week the Satmar community purchased it for £6.8million.
Rabbi Naftoli Mintz, assistant to the secretary of the Satmar community, said: "We are very happy. This is a rare site, in the centre of Stamford Hill where we all live.
"We haven't formalised plans yet but we hope the building will be vacated by early January when we will complete the purchase."
Campaign leader and Yesodey Hatorah Schools' principal Rabbi Avraham Pinter, said: "We have been vindicated in running this campaign. It would have been a travesty if this was to become luxury housing. This will now meet the future needs for education in the Charedi community."