Rotational epitaxy of Mg(0001) film on the Si(111) surface has been demonstrated at room temperature using a Si(111)3×3-B surface reconstruction as a template. The 3×3-B reconstruction, which spontaneously forms on the surface of a heavily-doped Si(111) substrate upon annealing, prevents the formation of magnesium silicide and provides the proper orientation of the film at which the lattice mismatch is lowered down. The film has excellent crystal quality as revealed by diffraction, scanning tunneling microscopy at low temperature (60 K) and photoelectron spectroscopy methods. Density functional theory calculations prove the hexagonal close-packed structure typical for the bulk Mg. The film demonstrates a pronounced quantum-well states effect. The energy position of the surface state is close to the relaxed bulk-like position at early stages of growth, which indicates the smaller interaction of the film with the substrate compared to growth on the bare Si(111).