Amides are converted to primary amines that are one carbon shorter via the Hofmann rearrangement. The base deprotonates the amide, which attacks the halogen, forming an N-haloamide. The N-haloamide is then deprotonated by the base, forming an N-haloamide salt that quickly undergoes a concerted rearrangement to produce isocyanate. Water attacks isocyanate, creating carbamic acid, which releases carbon dioxide gas to make the 1° amine.