Endogenous viral elements (EVEs) are increasingly found in eukaryotic genomes, yet little is known about their origins, dynamics, or function. Here, we provide a compelling example of a DNA virus that readily integrates into a eukaryotic genome where it acts as an inducible antiviral defense system. We found that the virophage mavirus, a parasite of the giant Cafeteria roenbergensis virus (CroV), integrates at multiple sites within the nuclear genome of the marine protozoan Cafeteria roenbergensis. The endogenous mavirus is structurally and genetically similar to the eukaryotic Maverick/Polinton DNA transposons and endogenous polintoviruses. Provirophage genes are not constitutively expressed, but are specifically activated by superinfection with CroV, which induces the production of infectious mavirus particles. Virophages inhibit the replication of giant viruses and a beneficial effect of provirophages on their host cells has been hypothesized. We found that provirophage-carrying cells are not directly protected from CroV; however, lysis of these cells releases reactivated mavirus particles that are then able to suppress CroV replication and enhance host survival of other CroV-infected flagellate populations in a dose-dependent manner. The host-parasite interaction described here involves an altruistic aspect that is unique among microbes. Our results demonstrate a direct link between mavirus and Maverick/Polinton elements and suggest that provirophages can defend natural protist populations against infection by giant viruses.