In non-photosynthetic eukaryotes such as animals, fungi, and protozoa, as well as the class Alphaproteobacteria of bacteria, it is produced by the enzyme ALA synthase, from glycine and succinyl-CoA. This reaction is known as the Shemin pathway, which occurs in mitochondria.
In plants, algae, bacteria (except for the class Alphaproteobacteria) and archaea, it is produced from glutamic acid via glutamyl-tRNA and glutamate-1-semialdehyde. The enzymes involved in this pathway are glutamyl-tRNA synthetase, glutamyl-tRNA reductase, and glutamate-1-semialdehyde 2,1-aminomutase. This pathway is known as the C5 or Beale pathway. In most plastid-containing species, glutamyl-tRNA is encoded by a plastid gene, and the transcription, as well as the following steps of C5 pathway, take place in plastids.