We present a hydrodynamical simulation at sub-parsec and few-solar-mass resolution of a merger between two gas-rich dwarf galaxies. Our simulation includes a detailed model for the multi-phase interstellar medium and is able to follow the entire formation history of spatially resolved star clusters, including feedback from individual massive stars. Shortly after the merger we find a population of ∼900 stellar clusters with masses above 102.5 Mo and a cluster mass function (CMF), which is well fitted with a power law with a slope of α=-1.70±0.08. We describe here in detail the formation of the three most massive clusters (M∗≥105Me), which populate the high-mass end of the CMF. The simulated clusters form rapidly on a timescale of 6-8Myr in converging flows of dense gas. The embedded merger phase has extremely high star formation rate surface densities of SSFR > 10 Me yr-1 kpc-2 and thermal gas pressures in excess of Pth ∼ 10 k K cm- - 7 B ( 3) 1. The formation process is terminated by rapid gas expulsion driven by the first generation of supernovae, after which the cluster centers relax and both their structure and kinematics become indistinguishable from observed local globular clusters (GCs). The simulation presented here provides a general model for the formation of metal-poor GCs in chemically unevolved starbursting environments of low-mass dwarf galaxies, which are common at high redshifts.