Starch, unlike hydrosoluble glycogen particles, aggregates into insoluble, semicrystalline granules. In photosynthetic eukaryotes, the transition to starch accumulation occurred after plastid endosymbiosis from a preexisting cytosolic host glycogen metabolism network. This involved the recruitment of a debranching enzyme of chlamydial pathogen origin. The latter is thought to be responsible for removing misplaced branches that would otherwise yield a water-soluble polysaccharide. We now report the implication of starch debranching enzyme in the aggregation of semicrystalline granules of single-cell cyanobacteria that accumulate both glycogen and starch-like polymers. We show that an enzyme of analogous nature to the plant debranching enzyme but of a different bacterial origin was recruited for the same purpose in these organisms. Remarkably, both the plant and cyanobacterial enzymes have evolved through convergent evolution, showing novel yet identical substrate specificities from a preexisting enzyme that originally displayed the much narrower substrate preferences required for glycogen catabolism.