This report details the discovery and characterization of a versatile bacterial cytochrome P450, NzeB, which catalyzes the dimerization of diketopiperazines via enzymatic C–H functionalization. This includes the first high-resolution crystal structure of a diketopiperazine dimerase, which along with active site via mutagenesis and quantum mechanical calculations, provides insight into the selectivity and mechanism of these enzymes.