The first total synthesis of amphiasterin B4, a secondary metabolite previously isolated from Plakortis quasiamphiaster has been achieved. The core structure has been reached according to a highly stereoselective one-pot epoxidation/cyclization of an unsaturated diol. This substrate can be prepared from beta,gamma-unsaturated diesters readily available from the organocatalyzed protonation of a transient dienol generated by UV irradiation of corresponding alpha,beta-unsaturated isomers.