According to the endosymbiotic theory of the origin of both chloroplasts and mitochondria, the ancestors of these two organelles were free-living prokaryotic cells. This theory states that an early eukaryotic cell engulfed a prokaryotic cell by endocytosis, much as one of our phagocytic white blood cells engulfs a bacterium.