  During a search for coherent signals in the X-ray archival data of
XMM-Newton, we discovered a modulation at 1.2 s in 3XMM J004301.4+413017 (3X
J0043), a source lying in the direction of an external arm of M 31. This short
period indicates a neutron star (NS). Between 2000 and 2013, the position of 3X
J0043 was imaged by public XMM-Newton observations 35 times. The analysis of
these data allowed us to detect an orbital modulation at 1.27 d and study the
long-term properties of the source. The emission of the pulsar was rather hard
(most spectra are described by a power law with $\Gamma < 1$) and, assuming the
distance to M 31, the 0.3-10 keV luminosity was variable, from
$\sim$$3\times10^{37}$ to $2\times10^{38}$ erg s$^{-1}$. The analysis of
optical data shows that, while 3X J0043 is likely associated to a globular
cluster in M 31, a counterpart with $V\gtrsim22$ outside the cluster cannot be
excluded. Considering our findings, there are two main viable scenarios for 3X
J0043: a peculiar low-mass X-ray binary, similar to 4U 1822-37 or 4U 1626-67,
or an intermediate-mass X-ray binary resembling Her X-1. Regardless of the
exact nature of the system, 3X J0043 is the first accreting NS in M 31 in which
the spin period has been detected.
