Heterocyst-forming cyanobacteria grow as filaments of cells (trichomes) in which, under nitrogen limitation, two interdependent cell types, the vegetative cells performing oxygenic photosynthesis and the nitrogen-fixing heterocysts, exchange metabolites and regulatory compounds. SepJ is a protein conspicuously located at the cell poles in the intercellular septa of the filaments that has three well-defined domains: an N-terminal coiled-coil domain, a central linker and a C-terminal permease domain. Mutants of Anabaena sp. strain PCC 7120 carrying SepJ proteins with specific deletions showed that, whereas the linker domain is dispensable, the coiled-coil domain is required for polar localization of SepJ, filament integrity, normal intercellular transfer of small fluorescent tracers and diazotrophy. An Anabaena strain carrying the SepJ protein from the filamentous, non-heterocyst-forming cyanobacterium Trichodesmium erythraeum, which lacks the linker domain, made long filaments in the presence of combined nitrogen but fragmented extensively under nitrogen deprivation and did not grow diazotrophically. In contrast, a chimera made of the Trichodesmium coiled-coil domain and the Anabaena permease allowed heterocyst differentiation and diazotrophic growth. Thus, SepJ provides filamentous cyanobacteria with a cell–cell anchoring function, but the permease domain has evolved in heterocyst formers to provide intercellular molecular exchange functions required for diazotrophy.