Endozoicomonadaceae bacteria are widespread in many marine animals, and generally considered beneficial. Members of one clade, however,CandidatusEndonucleobacter, infect the nuclei of deep-sea mussels, where they replicate to ≥ 80,000 bacteria per nucleus and cause the nuclei to swell to 50 times their original size. How these parasites are able to persist in host nuclei without the cell undergoing apoptosis is not known. We show here that Ca. Endonucleobacter encodes and expresses 7-15 inhibitors of apoptosis (IAPs), proteins previously only known from animals and viruses. Dual RNA-seq transcriptomes of infected nuclei revealed parallel upregulation ofCa.Endonucleobacter IAPs and host caspases, suggesting an arms race between the parasite and host for control of apoptosis. Comparative phylogenetic analyses revealed thatCa.Endonucleobacter acquired IAPs repeatedly through horizontal gene transfer from their hosts in convergent acquisition, possibly mediated by herpes viruses that may infect both the parasite and the host.