Prince William and Prince Harry will be making a cameo in The Last Jedi next month - serving as First Order Stormtroopers during a brief scene with John Boyega.

The British actor confirmed their appearance during a taping of The Hollywood Reporter's Actor Roundtable, saying his character, Finn, would be guarded by them in an elevator.

"It was a great experience," Boyega said of filming with the two brothers.

The Force Awakens star told THR that William and Harry will be joining singer Gary Barlow and actor Tom Hardy as guest Stormtroopers in the highly-anticipated eighth instalment.

He said that being on set with them was more "fun" than intimidating, though there were moments where seeing Barlow, Hardy and the royals "wrapped in Stormtroopers costumes" made for a "strange contrast of a weird family".

Captain Phasma (Gwendoline Christie) and Stormtroopers in a scene from the movie Star Wars: The Last Jedi. Jonathan Olley

While their Last Jedi cameos will surely be the most star-studded in Star Wars history, they won't be the first.

Actor Daniel Craig served as a Stormtrooper in Episode VII and even got to utter a line to Daisy Ridley's character, Rey, as she attempted to use the Jedi mind-trick on him.

Several other big-name stars went unseen in the film - including Simon Pegg, who played junkyard dealer Unkar Plutt, and former SNL cast-member Bill Hader, who helped provide the voice for BB-8.

William and Harry's appearance had been rumoured since last year, along with Barlow's and Hardy's. But they were never confirmed by actors or producers. It's unclear how long they will be on screen or if any of them will have any lines.

Star Wars: The Last Jedi will be arriving in Australian theatres on December 14.

Prince Harry met Chewbacca during a tour of the Star Wars sets last year.