Pyrrolizidine alkaloids (PAs) are a structurally diverse group of heterocyclic specialized metabolites characterized by a core structure comprising a hexahydro-1H-pyrrolizine. PAs are synthesized through two main pathways. In plants, assembly occurs via a homospermidine synthase, and in bacteria, through combined action of a nonribosomal peptide synthetase and a Baeyer-Villiger monooxygenase. While the toxic properties of plant-derived PAs and their prevalence in animal and human foods have been extensively studied, the biological roles and biosynthesis of more complex bacterial PAs are not well understood. Here, we report the identification and characterization of a bacterial biosynthetic gene cluster fromXenorhabdus hominickii,xhpA-G, which is responsible for producing the PA pseudo-dimer pyrrolizwilline. Analysis ofX. hominickiipromoter exchange mutants together with heterologous expression ofxhpA-GinE. coli, revealed a set of pathway intermediates, two of which were chemically synthesized, as well as multiple derivatives. This information was leveraged to propose a detailed biosynthetic pathway to pyrrolizwilline. Furthermore, we have characterized the hydrolase XhpG, the key enzyme in the conversion of the pathway intermediate pyrrolizixenamide to pyrrolizwilline, using X-ray crystallography and small-angle X-ray scattering (SAXS).