Nietzsche's assertion that God is dead appears first in The Gay Science, where he writes,
God is dead. God remains dead. And we have killed him. How shall we comfort ourselves, the murderers of all murderers?
The idea is repeated in Thus Spake Zarathustra, when Zarathustra encounters a hermit who claims to devote his life to God. Zarathustra thinks to himself,
Could it be possible! This old saint has not heard in his forest that God is dead!
Although this idea has been interpreted in various ways, it is clear within the context of Nietzsche's work that he regards it as impossible to believe in God at the end of the nineteenth century. After the skepticism of the eighteenth-century Enlightenment, there were a number sustained intellectual attacks on Christian belief, particularly from the fields of science and classical textual criticism (Nietzsche's own speciality). Scientists demonstrated that the earth was far older than anyone had previously thought and that life had evolved over time rather than being created in its current forms. Classical scholars who had previously examined only literary texts turned their attention to the Bible, and found it riddled with errors and inconsistencies.
Nietzsche thought that the weight of evidence against the Bible being true was now so overwhelming that it was impossible for any intellectually honest person to be a Christian. He regarded this an an ironic conclusion to almost two thousand years of Christianity, remarking that Christian theology had placed such emphasis on the importance of truth that Christians seeking to discover the truth had destroyed their own religion.