Acquired immunity in prokaryotes is achieved by integrating short fragments of foreign nucleic acids into clustered regularly interspaced short palindromic repeats (CRISPRs). This nucleic acid-based immune system is mediated by a variable cassette of up to 45 protein families that represent distinct immune system subtypes. CRISPR-associated gene 1 (cas1) encodes the only universally conserved protein component of CRISPR immune systems, yet its function is unknown. Here we show that the Cas1 protein is a metal-dependent DNA-specific endonuclease that produces double-stranded DNA fragments of approximately 80 base pairs in length. The 2.2 A crystal structure of the Cas1 protein reveals a distinct fold and a conserved divalent metal ion-binding site. Mutation of metal ion-binding residues, chelation of metal ions, or metal-ion substitution inhibits Cas1-catalyzed DNA degradation. These results provide a foundation for understanding how Cas1 contributes to CRISPR function, perhaps as part of the machinery for processing foreign nucleic acids.