The Royal School Hampstead has been ‘‘rescued from the brink of closure’’, but parents at the exclusive establishment say they have been betrayed by a secret deal announced just days before the start of the new term.

The cash-strapped school, which has had close links with the Royal Family for more than a century, is to be bought by the education consortium Cognita in a deal which will see the prestigious 150-year-old school saved from its deep financial troubles.

The school was founded in 1855 by Queen Victoria and has had a succession of Royal patrons, the latest of whom is the Duchess of Cornwall.

The secretive deal will see the Rosslyn Hill school go co-ed and merge with Northbridge House School, which has three sites in north west London.

Parents were informed by letter last weekend – less than a fortnight before the deal is due to be sealed.

Trevor Colman, who is joint chair of the Royal Parents Association and who has a nine-year-old daughter, Ele, at the school, said: “There has been a real loss of trust. The trustees haven’t treated the parents with any respect.

“We were in the good schools guide for the first time ever this year and we should build on that success, not turn our back on it.”

Mr Colman, who was due to speak at a parents’ meeting called in response to the sale on Wednesday night (September 7), added: “Many parents chose the Royal School because it is a single-sex school with an excellent special needs department. They don’t want to lose that.”

Under the deal, the Royal School will become the senior school for Northbridge House, and the Gloucester Avenue site of Northbridge House will be turned into the junior school – meaning many pupils face moving to another site.

Parents will also have to pay up to �900 a term more in fees, and boarders could be moved to Somerset, as Northbridge House does not offer residential places. These changes will come into effect next September.

Fellow parent Alain Felder said: “They are turning over 150 years of history at the Hampstead School. I feel really let down.”

Chris Woodhead, Cognita chairman, and a former Chief Inspector of Schools under Tony Blair’s Labour Government, said parents could not be told of the planned sale earlier because the negotiations were confidential.

He said: “They could have announced that there wasn’t going to be a school any more but they wanted to try to find a future for it. I am committed to The Royal School, and particularly the wonderful support it gives to children with special needs, continues in the new school.”

Robin Field-Smith, chairman of Trustees, said: “The arrangement with Cognita ensures the continuity of a school, a whole academic year of no change to allow pupils, parents and staff to adjust, and access to investment.

“It has taken the best part of a year to arrive at this point, and all possible options were considered.”