A lot of sci-fi has magic and gods. The gods are frequently not omniscient omnipotent bodiless entities, but they're still gods, and the magic is often given a reason it exists, but it's still magic.
Basically everyone agrees that the Dune series is sci-fi, but it's got effectively magic, and effectively gods (with them even using those terms in the story IIRC —they at least use "god"), and they're usually fighting with swords. It's, by all reasonable arguments, fantasy. They aren't mutually exclusive.