Prolate rotation (i.e. rotation around the long axis) has been reported for two Local Group dwarf galaxies: Andromeda II, a dwarf spheroidal satellite of M31, and Phoenix, a transition type dwarf galaxy. The prolate rotation may be an exceptional indicator of a past major merger between dwarf galaxies. We showed that this type of rotation cannot be obtained in the tidal stirring scenario, in which the satellite is transformed from disky to spheroidal by tidal forces of the host galaxy. However, we successfully reproduced the observed Andromeda II kinematics in controlled, self-consistent simulations of mergers between equal-mass disky dwarf galaxies on a radial or close-to-radial orbit. In simulations including gas dynamics, star formation and ram pressure stripping, we are able to reproduce more of the observed properties of Andromeda II: the unusual rotation, the bimodal star formation history and the spatial distribution of the two stellar populations, as well as the lack of gas. We support this scenario by demonstrating the merger origin of prolate rotation in the cosmological context for sufficiently resolved galaxies in the Illustris large-scale cosmological hydrodynamical simulation.