Esterification reactions are central to many aspects of industrial and biological chemistry. The formation of carboxyesters typically occurs through nucleophilic attack of an alcohol onto the carboxylate carbon. Under certain conditions employed in organic synthesis, the carboxylate nucleophile can be alkylated to generate esters from alkyl halides, but this reaction has only been observed transiently in enzymatic chemistry. Here, we report a carboxylate alkylating enzyme - BrtB - that catalyzes O-C bond formation between free fatty acids of varying chain length and the secondary alkyl halide moieties found in the bartolosides. Guided by this reactivity, we uncovered a variety of natural fatty acid-bartoloside esters, previously unrecognized products of the bartoloside biosynthetic gene cluster.