Polymyxins remain one of the few antibiotics available for treating antibiotic resistant bacteria. Here we describe polymyxin B thioesterase which performs the final step in polymyxin B biosynthesis. Isolated thioesterase catalyzed cyclization of an Nacetylcystamine polymyxin B analogue to form polymyxin B. The thioesterase contained a catalytic cysteine unlike most thioesterases which possess a serine. Supporting this, incubation of polymyxin B thioesterase with reducing agents abolished enzymatic activity, while mutation of the catalytic cysteine to serine significantly decreased activity. NMR spectroscopy demonstrated that uncyclized polymyxin B was disordered in solution, unlike other thioesterase substrates which adopt a transient structure similar to their product. Modeling showed the thioesterase substrate-binding cleft was highly negatively charged, suggesting a mechanism for the cyclization of the substrate. These studies provide new insights into the role of polymyxin thioesterase in polymyxin biosynthesis and highlight its potential use for the chemoenzymatic synthesis of polymyxin lipopeptides.