Bacteria and their viruses (bacteriophages or phages) are engaged in an intense evolutionary arms race1-5. While the mechanisms of many bacterial antiphage defence systems are known1, how these systems avoid toxicity outside infection yet activate quickly after infection is less well understood. Here we show that the bacterial phage anti-restriction-induced system (PARIS) operates as a toxin-antitoxin system, in which the antitoxin AriA sequesters and inactivates the toxin AriB until triggered by the T7 phage counterdefence protein Ocr. Using cryo-electron microscopy, we show that AriA is related to SMC-family ATPases but assembles into a distinctive homohexameric complex through two oligomerization interfaces. In uninfected cells, the AriA hexamer binds to up to three monomers of AriB, maintaining them in an inactive state. After Ocr binding, the AriA hexamer undergoes a structural rearrangement, releasing AriB and allowing it to dimerize and activate. AriB is a toprim/OLD-family nuclease, the activation of which arrests cell growth and inhibits phage propagation by globally inhibiting protein translation through specific cleavage of a lysine tRNA. Collectively, our findings reveal the intricate molecular mechanisms of a bacterial defence system triggered by a phage counterdefence protein, and highlight how an SMC-family ATPase has been adapted as a bacterial infection sensor.