The correct response is:
They used to be free-living prokaryotes that functioned as unicellular organisms.
Mitochondria and chloroplasts are thought to have originated from free-living prokaryotic organisms that were engulfed by ancestral eukaryotic cells, a process known as endosymbiosis. This evolutionary history is the reason they have their own DNA, which is distinct from the nuclear DNA of the host cell.