The singer revealed the news on ITV's Lorraine show on Monday.
"I'm not a stormtrooper but I am in it," Barlow said. But he refused to give away any clues as to what part he would play.
The Last Jedi follows on from The Force Awakens, featuring Rey (Daisy Ridley) and runaway stormtrooper Finn (John Boyega). The film is out in December.
Barlow joked that, having revealed the news, he'll "probably be out" of the film.
He added: "I think the Star Wars people are so strict about what information (is out there). So me saying that, I've probably just done myself out of a role."
But any worried fans were quickly reassured by Lorraine's Dan Wootton, who confirmed ITV did check with Star Wars bosses before airing the news.
Cast members returning for Episode VIII include Oscar Isaac, Anthony Daniels and Lupita Nyong'o.
It will also feature the late Carrie Fisher, as she had finished filming before her death in December last year.
The film was originally due for release in May but was put back to December.
No official reason was given, but there had been speculation that the script was being rewritten.
Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.
Take That star Gary Barlow has revealed he has a part in new Star Wars film The Last Jedi.