The mechanism of oxidative epoxidation catalyzed by HppE, which is the ultimate step in the biosynthesis of fosfomycin, was studied by using hybrid DFT quantum chemistry methods. An active site model used in the computations was based on the available crystal structure for the HppE-FeII-(S)-HPP complex and it comprised first-shell ligands of iron as well as second-shell polar groups interacting with the substrates. The reaction energy profiles were constructed for three a priori plausible mechanisms proposed in the literature, and it was found that the most likely scenario for the native substrate, that is, (S)-HPP, involves generation of the reactive FeIIIO./FeIVO species, which is responsible for the CH bond-cleavage. At the subsequent reaction stage, the OH-rebound, which would lead to a hydroxylated product, is prevented by a fast protonation of the OH ligand and, as a result, ring closure is the energetically preferred step. For the R enantiomer of the substrate ((R)-HPP), which is oxidized to a keto product, comparable barrier heights were found for the CH bond activation by both the FeIIIO2. and FeIVO species.