JK Rowling has revealed that she is not the scriptwriter for the new Harry Potter stage play while settling a chemistry student's five year bet with her teacher.

Victoria Green bet her teacher Robert Hernandez in 2011 that Ms Rowling would 'not write, publish, or announce another novel about Harry Potter' before May 1 2017, the year she graduates from college.

Following the announcement that the script for Harry Potter and the Cursed Child would be released later this year, Ms Green tweeted Ms Rowling to ask who had won the bet.

Ms Rowling said that, despite the publication of its script, Harry Potter and the Cursed Child is a play and its 'wonderful writer is Jack Thorne'.

The Harry Potter author has worked very closely with Mr Thorne on the script for the play, which is based on an original story by Ms Rowling, Mr Thorne and John Tiffany.

Ms Rowling's tweet caused confusion amongst Harry Potter fans on Twitter.

Ms Rowling revealed earlier this week that print and digital editions of the Harry Potter and the Cursed Child script will be published simultaneously after its world premiere in London's West End on July 30.

The new sequel opens for previews several weeks before its official world premiere.

It stars Jamie Parker as the famous wizard in the play alongside Noma Dumezweni  and Paul Thornley as Hermione and Ron.