Bacteria possess an array of defenses against foreign invaders, including a broadly distributed bacteriophage defense system termed CBASS (cyclic oligonucleotide-based anti-phage signaling system). In CBASS systems, a cGAS/DncV-like nucleotidyltransferase synthesizes cyclic di- or tri-nucleotide second messengers in response to infection, and these molecules activate diverse effectors to mediate bacteriophage immunity via abortive infection. Here, we show that the CBASS effector NucC is related to restriction enzymes but uniquely assembles into a homotrimer. Binding of NucC trimers to a cyclic tri-adenylate second messenger promotes assembly of a NucC homohexamer competent for non-specific double-strand DNA cleavage. In infected cells, NucC activation leads to complete destruction of the bacterial chromosome, causing cell death prior to completion of phage replication. In addition to CBASS systems, we identify NucC homologs in over 30 type III CRISPR/Cas systems, where they likely function as accessory nucleases activated by cyclic oligoadenylate second messengers synthesized by these systems’ effector complexes.