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-Fe(II)-(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 Fe(III)-O·/Fe(IV)=O species, which is responsible for the C-H 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 C-H bond activation by both the Fe(III)-O(2)· and Fe(IV)=O species.