Dumezwani, an actor of South African heritage, is to play one of the three main roles in the Palace theatre production of Harry Potter and the Cursed Child, which opens in July 2016. She will star alongside Jamie Parker as an adult Harry Potter and Paul Thornley as Ron Weasley.

Asked on Twitter how she felt about the choice of actor to play Hermione, who in the Warner Brothers film franchise was portrayed by the actor Emma Watson, Rowling responded:

Dumezweni, 45, was born in Swaziland to South African parents and moved to England as a child. She won the Olivier award for best performance in a supporting role for her work in 2005’s A Raisin in the Sun, and recently replaced Kim Cattrall in Penny Skinner’s play Linda in a “knockout” performance, according to the Guardian critic Susannah Clapp.

The forthcoming stage production of Potter is written by the Skins and This is England (’86 and ’88) writer Jack Thorne. It is based on a story Thorne wrote with the director John Tiffany and Rowling.

The two-part play is set 19 years after the seven-part book series ended, and casts Potter as an “overworked employee of the Ministry of Magic, a husband and a father of three school-age children”, according to the play’s website.

“While Harry grapples with a past that refuses to stay where it belongs, his youngest son, Albus, must struggle with the weight of a family legacy he never wanted. As past and present fuse ominously, both father and son learn the uncomfortable truth: sometimes, darkness comes from unexpected places.”

Parker, 36, is best known for his role as the original Scripps in Alan Bennett’s play The History Boys, and Thornley, 40, for his roles in Doc Martin and London Road.

Speaking about the casting, Rowling told the Harry Potter website Pottermore: “I’m so excited with the choice of casting for Harry Potter and the Cursed Child. I can’t wait to see Jamie, Noma and Paul bring the adult Harry, Hermione and Ron to life on stage next summer.”

Thorne tweeted:

Jack Thorne (@jackthorne)

Noma, Jamie & Paul will be the most brilliant three. We're very lucky to have them. And to assure all doubters - Paul is ginger in his soul.

She was a last-minute lead in the three-hour Linda and will play JK Rowling’s grown-up Hermione Granger in the West End. Now Noma Dumezweni is making her directorial debut with the thriller I See You at the Royal Court