Prince William and Prince Harry have made cameo appearances in the next Star Wars film, actor John Boyega has confirmed.

The royals visited the set of Star Wars Episode VIII: The Last Jedi in April 2016 where they were taken on a tour of Pinewood Studios and met with the star cast. It was widely rumoured at the time, that the princes, who are ardent fans of the sci-fi franchise, dressed as storm troopers for a scene.

While Boyega was earlier sworn to secrecy over the royals' film debuts, the actor who plays reformed stormtrooper Finn, has now confirmed that he shared a scene with the pair who he said were "wrapped in stormtroopers costumes".

During a round table interview for the Hollywood Reporter, Boyega said "It was a great experience,"

"It makes you feel like you're a part of history in a sense," he added.

Asked earlier whether the Princes were given speaking parts Boyega joked: "I think they took that scene out."

He also revealed that Tom Hardy and Take That singer Gary Barlow appear in the scene, adding that the celebrity stormtroopers and the royals, made for a "strange contrast of a weird family".

A source at the time said the princes also 'filmed a scene in which Rey and Finn infiltrate a secret base."

Prince Harry William Star Wars
The royals pose with Star Wars cast and crew members, including Mark Hamill, director Rian Johnson, John Boyega, Chewbacca and Daisy Ridley Adrian Dennis/AFP

"The rebel characters are in a lift with Benicio del Toro's character when a group of Stormtroopers enter - two of whom are William and Harr,"the source revealed.'

Prince William who admitted he was a 'total geek' over the franchise, was photographed hugging Chewbacca played by Joonas Suotamo and he challenged his brother to a duel with lightsabers.

The royals also posed for a group photo with cast members including Mark Hamill, who plays Luke Skywalker, Boyega, Daisy Ridley and director Rian Johnson.

Kensington Palace declined to comment on the Princes' roles in the eagerly anticipated movie.