The science fiction genre has roots in ancient mythology, from Indian to Greek and everything in between. Although the first officially recognized work of sci-fi came about with the publication of Mary Shelley's Frankenstein in the early 19th century, this genre has since become one of the most popular narrative foundations of the last few decades.
Source:https://www.cbr.com/best-sci-fi-movies-from-books/