Apicomplexa are unicellular eukaryotes and obligate intracellular parasites, including Plasmodium, the causative agent of malaria and Toxoplasma, one of the most widespread zoonotic pathogens. Rhoptries, one of their specialized secretory organelles, undergo regulated exocytosis during invasion. Rhoptry proteins are injected directly into the host cell to support invasion and subversion of host immune function. The mechanism by which they are discharged is unclear and appears distinct from those in bacteria, yeast, animals or plants. Here we show that rhoptry secretion in Apicomplexa shares structural and genetic elements with the exocytic machinery of ciliates, their free-living relatives. Rhoptry exocytosis depends on intramembranous particles in the shape of a rosette embedded into the plasma membrane of the parasite apex. Formation of this rosette requires multiple Non-discharge (Nd) proteins conserved and restricted to Ciliata, Dinoflagellata, and Apicomplexa that together constitute the superphylum Alveolata. We identified Nd6 at the site of exocytosis in association with an apical vesicle. Sandwiched between the rosette and the tip of the rhoptry, this vesicle appears as a central element of the rhoptry secretion machine. Our results describe a conserved secretion system that was adapted to provide defense for free-living unicellular eukaryotes and host cell injection in intracellular parasites.