The vampires of Richard Matheson's story I Am Legend are very similar to vampires of myth and folklore, but whereas classic vampires are believed to be related to demons and have magical qualities about them, the origins of Matheson's vampires are based in the realm of science. In the book, humanity is all but wiped out when the population becomes infected by a form of bacteria, transforming them into bloodthirsty creatures of the night. The only known survivor of the Vampiris plague is the story's protagonist Robert Neville, who is immune to the disease and tries desperately to live out his days in peace in the midst of this undead apocalypse. At night, Neville remains sheltered in his house only for a mob of vampires to regularly torment him by urging him to come out. The vampires never enter Neville's home as Neville hangs garlic outside his door and uses other defences such as crucifixes and mirrors. The infected vampires are not actually physically vulnerable to these items but they believe themselves to be due to psychological conditioning through exposure to common legends and stories revolving around vampires.
Over the agonizing years of surviving alone, Neville researches into curing the vampire pandemic with little success and develops new methods of slaying vampires besides merely staking them in the heart. During this time, however, the vampires have also been evolving and eventually develop a tolerance for sunlight, allowing them to spend brief periods of time outside during the day. While Neville has been isolated, the vampires have been gathering and building a new social order, one free of the mistakes of the past. As the last remnant of the old order, Neville is regarded with fear and hatred by this new vampire society, and towards the end of the novel they come for him and capture him. In his last moments before he is put to death, Neville comes to the realization that he has become a legend to this new race born of the infection and he accepts his fate.