Apocalyptic fiction is a sub-genre of science fiction that is concerned with the end of human civilization. This apocalypse is typically portrayed as being due to a potentially existential catastrophe such as nuclear warfare, pandemic, extraterrestrial attack, impact event, cybernetic revolt, technological singularity, dysgenics, supernatural phenomena, divine judgment, runaway climate change, resource depletion, ecological collapse, or some other general disasters. Post-apocalyptic fiction is set in a world or civilization after such a disaster. The time frame may be immediately after the catastrophe, focusing on the travails or psychology of survivors, or considerably later, often including the theme that the existence of pre-catastrophe civilization has been forgotten (or mythologized). Post-apocalyptic stories often take place in a non-technological future world, or a world where only scattered elements of technology remain.
The genre gained popularity after World War II, when the possibility of global annihilation by nuclear weapons entered the public consciousness. However, recognizable apocalyptic novels had existed since the first quarter of the 19th century, when Mary Shelley's The Last Man was published.