Members of the conserved Argonaute protein family use small RNA guides to find their mRNA targets to regulate gene expression and suppress mobile genetic elements in eukaryotes1,2. Argonautes are also present in many bacterial and archaeal species3–5. Unlike eukaryotic proteins, several studied prokaryotic Argonautes use small DNA guides to cleave DNA, a process dubbed DNA interference6–10. However, the natural functions and targets of DNA interference are poorly understood, and the mechanisms of DNA guide generation and target discrimination remain unknown. Here, we studied the in vivo activities of a bacterial Argonaute nuclease from Clostridium butyricum (CbAgo). We demonstrated that CbAgo targets multicopy genetic elements and suppresses propagation of plasmids and infection by phages. CbAgo induces DNA interference between homologous sequences and triggers DNA degradation at double-strand breaks in the target DNA. Loading of CbAgo with locus-specific small DNA guides depends on both its intrinsic endonuclease activity and the cellular double-strand break repair machinery. A similar interplay was reported for acquisition of new spacers during CRISPR adaptation, and prokaryotic genomes encoding pAgo nucleases are enriched in CRISPR-Cas systems. These results identify molecular mechanisms that generate guides for DNA interference and suggest common principles of recognition of foreign nucleic acids by prokaryotic defense systems involves common principles.