A terminally ill Star Wars fan, who was given just a few months to live, was granted his wish to see the new The Force Awakens film on Thursday (5 November), nearly two months before it comes out in theatres.

Daniel Fleetwood, a 31-year-old Texas man suffering from an aggressive form of cancer that has spread to 90 percent of his lungs, was able to watch an early cut of the highly anticipated new Star Wars film, his wife Ashley Fleetwood said on Facebook.

"Daniel just finished watching an unfinished version of Star Wars: The Force Awakens!!! We would like to thank the awesomely talented JJ Abrams for calling us yesterday to tell us Daniel was getting his wish granted!" she said.

Daniel Fleetwood's dying wish to see The Force Awakens went viral on social media in the past week with the hashtag #ForceForDaniel, which garnered the support of Star Wars actors Mark Hamill, Peter Mayhew and newcomer John Boyega. Hamill tweeted on Thursday that he was "elated" that Fleetwood had been able to see the film.

This isn't the first time director JJ Abrams has brought a sick fan joy with an advance screening: he did the same for Daniel Craft with an early showing of Star Trek: Into Darkness in 2013 just days before Craft's ultimate death.

Fleetwood and his wife have been documenting his health on social media, and in September he posted an update saying he had been given one or two months to live, due to how fast the cancer had spread.

Disney said on Thursday that the screening for Fleetwood had taken place and that "all involved were happy to be able to make it happen." The company did not say where the screening took place, but given Fleetwood's poor health, it is likely to have been at his home.