The first four words in the title crawl are literally βa long time agoβ ;-)
But on a more serious note, itβs kind of a mix of both sci-fi and fantasy. There are fantasy tropes such as magic (the force), good and evil wizards (the Jedi and the Sith), swords and dueling (light sabers) etc. In many ways it is more like LOTR than Star Trek: Obi Wan is like Gandalf, Luke is like Frodo etc. Also none of the technology is ever explained, there is no techno-babble.
On the other hand there are lots of sci-fi elements such as spaceships, aliens, technology etc. So on the surface it seems like science fiction, but it borrows lots of stuff from fantasy.