The point-like X-ray source HLX-1 is the brightest known ultraluminous X-ray source and likely the strongest intermediate-mass black hole candidate. HLX-1 is hosted in the S0 galaxy ESO 243-49, but offset with respect to the nucleus, and its optical counterpart was identified with a massive star cluster. In this paper, we study, through N-body/smoothed particle hydrodynamics simulations, the scenario where ESO 243-49 is undergoing (or just underwent) a minor merger with a gas-rich low-mass late-type galaxy. The simulations suggest that the observed star formation rate (SFR) in ESO 243-49 is a consequence of the interaction and that the companion galaxy already underwent the second pericentre passage. We propose that the counterpart of HLX-1 coincides with the nucleus (and possibly with the nuclear star cluster) of the secondary galaxy. We estimate that, if the minor merger scenario is correct, the number density of X-ray sources similar to HLX-1 is ≈10-6 Mpc-3.