Bacteria evolved restriction endonucleases to prevent interspecies DNA transmission and bacteriophage infection. Here we show that human cells possess an analogous mechanism. APOBEC3A is induced by interferon following DNA detection, and it deaminates foreign double-stranded DNA cytidines to uridines. These atypical DNA nucleosides are converted by the uracil DNA glycosylase UNG2 to abasic lesions, which lead to foreign DNA degradation. This mechanism is evident in cell lines and primary monocytes, where up to 97% of cytidines in foreign DNA are deaminated. In contrast, cellular genomic DNA appears unaffected. Several other APOBEC3s also restrict foreign gene transfer. Related proteins exist in all vertebrates, indicating that foreign DNA restriction may be a conserved innate immune defense mechanism. The efficiency and fidelity of genetic engineering, gene therapy, and DNA vaccination are likely to be influenced by this anti-DNA defense system.