A heterocyst is a specialized cell found in certain filamentous cyanobacteria. It is responsible for nitrogen fixation in an anaerobic environment by converting atmospheric nitrogen into a form that can be used by the organism. Heterocysts have thicker cell walls and lack photosynthetic pigments to create an anaerobic environment for nitrogen fixation.