The DNA sensor cGAS initiates innate immune responses following microbial infection, cellular stress, and cancer1. Upon activation by double-stranded DNA, cytosolic cGAS produces 2’3’ cyclic GMP-AMP and triggers inflammatory cytokine and type I interferon (IFN) induction2–7. cGAS is also present inside the cell nucleus replete with genomic DNA8, where chromatin has been implicated in restricting its enzymatic activity9. However, the structural basis for cGAS inhibition by chromatin has remained unknown. Here we present the cryo-electron microscopy structure of human cGAS bound to nucleosomes at 3.1 Å resolution. cGAS makes extensive contacts with both the acidic patch of the histone H2A-H2B heterodimer and nucleosomal DNA. The structural and complementary biochemical analysis also finds cGAS engaged to a second nucleosome in trans. Mechanistically, nucleosome binding locks cGAS in a monomeric state, in which steric hindrance suppresses spurious activation by genomic DNA. We find that mutations to the cGAS-acidic patch interface are necessary and sufficient to abolish the inhibitory effect of nucleosomes in vitro and to unleash cGAS activity on genomic DNA in living cells. Our work uncovers the structural basis of cGAS interaction with chromatin and defines a compelling mechanism that permits self-nonself discrimination of genomic DNA by cGAS.