Heterocysts play an important role in fixing nitrogen in filamentous cyanobacteria when low levels of fixed nitrogen are present in the environment.
Cells along a filamentous cyanobacteria are capable of differentiating into heterocysts at regular intervals, with fixed nitrogen diffusing along the length of the filament to neighbouring vegetative cells.
During the formation of a heterocyst, the cell wall thickens to allow oxygen to be excluded. The formation of a microoxic environment is important during nitrogen fixation – nitrogenase is inhibited by the presence of oxygen. Neighbouring vegetative cells provide sucrose to the heterocyst.