An enzyme that catalyzes the tetrapolymerization of the monopyrrole porphobilinogen into the hydroxymethylbilane preuroporphyrinogen (uroporphyrinogens) in several discrete steps. It is the third enzyme in the 8-enzyme biosynthetic pathway of heme. In humans, deficiency in this enzyme encoded by HMBS (or PBGD) gene results in a form of neurological porphyria (porphyria, acute intermittent). This enzyme was formerly listed as EC 4.3.1.8