  We show that the r-mode instability can generate strong toroidal fields in
the core of accreting millisecond quark stars by inducing differential
rotation. We follow the spin frequency evolution on a long time scale taking
into account the magnetic damping rate in the evolution equations of r-modes.
The maximum spin frequency of the star is only marginally smaller than in the
absence of the magnetic field. The late-time evolution of the stars which enter
the r-mode instability region is instead rather different if the generated
magnetic fields are taken into account: they leave the millisecond pulsar
region and they become radio pulsars.
