I Am Legend is a 2007 American post-apocalyptic action thriller film loosely based on the 1954 novel of the same name by Richard Matheson. Directed by Francis Lawrence from a screenplay by Akiva Goldsman and Mark Protosevich, the film stars Will Smith as US Army virologist Robert Neville. It is set in New York City after a virus, which was originally created to cure cancer, has wiped out most of mankind, leaving Neville as the last human in New York, other than nocturnal mutants. Neville is immune to the virus, and he works to develop a cure while defending himself against the hostile mutants. It is the third feature-film adaptation of Matheson's 1954 novel "I Am Legend", following 1964's "The Last Man on Earth" and 1971's "The Omega Man".