The BBC has agreed a deal to sell the EastEnders set and its other studios at Elstree, Hertfordshire, as part of a drive to raise funds.
The TV soap will still be filmed on the site, however, after the BBC also agreed to lease back Albert Square from its new owner, insurance giant Axa.
The price Axa will pay for the 16-acre site has not been disclosed, but the BBC was reportedly looking for £70m.
It comes as the broadcaster has to find £500m in annual savings.
“The sale of the Elstree Centre site is part of an ongoing review of the BBC’s property portfolio in order to provide the best value for licence fee payers,” chief financial officer Alan Dickson said.
“As part of the sale, the EastEnders site has been secured on a long-term lease and Elstree will continue to be the home of Albert Square.”
The sale comes two years after the BBC finished rebuilding the EastEnders set at a cost of £87m, which was £27m over budget and four years late.
The BBC’s Elstree complex has also previously been home to programmes like Children in Need, Casualty, Holby City, Top of the Pops and election night broadcasts.
But it does not include a separate nearby studio complex where Strictly Come Dancing is based, and where films like Star Wars and TV shows including The Crown have been shot.
The BBC also recently sold its Maida Vale music studios and is due to move out of Wogan House, in central London, which is home to Radio 2.
Axa said it would redevelop the historic Elstree complex to capitalise on the high demand for UK film and TV studios.
John O’Driscoll, global co-head of real estate for AXA IM Alts, said: “The structure of the transaction allows the BBC to continue its production on the site for at least another 25 years, while providing us with the opportunity to invest in the site to create new world-class studios.
“The whole area has a long and illustrious history of producing some of the world’s most celebrated films and television series and, under our stewardship, we aim to continue that legacy.”