Viral infection triggers innate immune sensors to produce type I interferon. However, infection of T cells and macrophages with human immunodeficiency virus (HIV) does not trip those alarms. How HIV avoids activating nucleic acid sensors is unknown. Here we found that the cytosolic exonuclease TREX1 suppressed interferon triggered by HIV. In Trex1(-/-) mouse cells and human CD4(+) T cells and macrophages in which TREX1 was inhibited by RNA-mediated interference, cytosolic HIV DNA accumulated and HIV infection induced type I interferon that inhibited HIV replication and spreading. TREX1 bound to cytosolic HIV DNA and digested excess HIV DNA that would otherwise activate interferon expression via a pathway dependent on the kinase TBK1, the adaptor STING and the transcription factor IRF3. HIV-stimulated interferon production in cells deficient in TREX1 did not involve known nucleic acid sensors.