Daniel Radcliffe and Emma Watson are to star in a new Harry Potter scene which has been written especially for a show to mark the Queen's 80th birthday.
More than 30 stars of stage and screen will appear at the palace
They will be joined on stage by famous literary characters including Rupert the Bear, Noddy and Paddington.
Jonathan Ross will play the Fat Controller from Thomas the Tank Engine at the Queen's Handbag show on 25 June.
Julie Walters, Martin Clunes and Ronnie Corbett are also confirmed to appear before an audience of 3,000 people.
Two-thirds of them are children and all won tickets to the event in a ballot.
Radcliffe and Watson, Hermione in the Harry Potter films, will appear in one scene with fellow stars Rupert Grint, who plays Ron, and Matthew Lewis, best-known as Neville.
Comedian Harry Hill has been cast as an owl keeper at Hogwarts, the fictional school of magic which they all attend.
Comedian Harry Hill is to play the owl keeper at Hogwarts school
The exact storyline is being kept secret but the script was written by children's author and playwright David Wood.
Actor and author Julian Fellowes has been the executive script editor, with Sir Trevor Nunn as stage director.
The whole show will be broadcast live from the gardens of Buckingham Palace by BBC One and digital channel CBBC.