We have obtained optical spectra for the 14 brightest optical counterparts of X-ray sources identified by XMM-Newton in the direction of M 31 and for 21 optical counterparts in the direction of M 33, using the 1.3m Skinakas telescope in Crete, Greece.