Netflix has bought the rights to Roald Dahl’s classic children’s books from the author’s family.

The family of Roald Dahl, the author of some of the most famous children’s books ever-written, has gained more than £500m after agreeing to sell his works to Netflix, the US-based streaming giant.

It will enable the buyer to further exploit the Dahl catalogue through further film and other visual content spin-offs, as well as merchandising opportunities where the rights are not already owned by third parties. The deal means the streaming giant will own creations like Charlie and the Chocolate Factory and The BFG. Netflix will control what happens to them in publishing as well as TV and film – and receive the royalties. It will also create numerous spin-off games, stage shows and other live experiences.

Announced on Wednesday, the deal is the biggest acquisition in Netflix’s history and hands it a catalogue of books which have sold more than 300m copies globally. Netflix made the announcement by revealing its name on golden ticket hidden inside a Willy Wonka chocolate bar wrapper. The back of the ticket had the words “There is no knowing what we shall see” – a line from James and the Giant Peach.

The outright acquisition of the Dahl literary estate comes three years after it struck a deal with Netflix to produce a number of animated series based on the author’s works.

Roald Dahl; the author:

After working as a fighter pilot in the Second World War and then as a diplomat, the Welshman turned his hand to writing novels, short stories, poems and film scripts.

Throughout the 1960s, 70s and 80s he became known for best-selling children’s books – many of which were later turned into films.

The writer, who died at the age of 74 in 1990, has sold 300 million books around the world, printed in 65 languages. The Dahl catalogue also includes the likes of Fantastic Mr Fox, James and the Giant Peach, The Witches and The Twits.

Mr Dahl’s legacy has been complicated by allegations of anti-Semitism, views which reportedly led the Royal Mint to decline the opportunity to honour him with a commemorative coin in 2016, the centenary of his birth.

In December, Dahl’s family apologised for anti-Semitic comments made by the author in interviews in 1983 and 1990.

A big part  of the proceeds from the sale of the company will go towards setting up a new charity involved with children’s health, anti-hate and anti-racism, they said.