Context. The nature of the hard X-ray source XSS J12270-4859 is still unclear. It was claimed to be a possible magnetic cataclysmic variable of the Intermediate Polar type from its optical spectrum and a possible 860 s X-ray periodicity in RXTE data. However, recent observations do not support the latter variability, leaving this X-ray source still unclassified. Aims. To investigate its nature we present a broad-band X-ray and gamma ray study of this source based on a recent XMM-Newton observation and archival INTEGRAL and RXTE data. Using the Fermi/LAT 1-year point source catalogue, we tentatively associate XSS J12270-4859 with 1FGLJ1227.9-4852, a source of high-energy gamma rays with emission up to 10GeV. We further complement the study w...