Neutron stars that accrete matter transferred from a companion star are among the brightest known X-ray sources. The interplay between the neutron star magnetic field and matter determines a number of observable phenomena, like X-ray pulsations at the spin period of the neutron star and/or plasma outflows. These are invaluable probes to measure the physical properties of the compact object, test the effects of General relativity on the motion of matter, and understand the field-plasma interaction. I will review the main properties of X-ray pulsars in binary systems, with a high and a low mass companion star. A particular focus will be given to the case of the accretion-driven spin up of old neutron stars to rotational periods of a few milliseconds, and the relation of these sources with radio millisecond pulsars.