The origin of Galactic cosmic rays remains a matter of debate, but supernova remnants are commonly considered to be the main place where high-energy cosmic rays are accelerated. Nevertheless, current models predict cosmic-ray spectra that do not match observations and the efficiency of the acceleration mechanism is still undetermined. On the other hand, the contribution of other kinds of sources to the Galactic cosmic-ray population is still unclear, and merits investigation. In this work we explore a novel mechanism through which microquasars might produce cosmic rays. In this scenario, microquasar jets generate relativistic neutrons, which escape and decay outside the system; protons and electrons, created when these neutrons decay, escape to the interstellar medium as cosmic rays. The most promising scenarios arise in extremely luminous systems ($L_mathrm{jet} sim 10^{40},mathrm{erg , s}^{-1}$), in which the fraction of jet power deposited in cosmic rays can reach $sim 0.001$. Slow jets ($Gamma lesssim 2$, where $Gamma$ is the bulk Lorentz factor) favour neutron production. The resulting cosmic-ray spectrum is similar for protons and electrons, which share the power in the ratio given by neutron decay. The spectrum peaks at roughly half the minimum energy of the relativistic protons in the jet; it is soft (spectral index $sim 3$) above this energy, and almost flat below. Values of spectral index steeper than $2$ are possible for cosmic rays in our model and these indeed agree with those required to explain the spectral signatures of Galactic cosmic rays, although only the most extreme microquasars provide power comparable to that of a typical supernova remnant. The mechanism explored in this work may provide stronger and softer cosmic-ray sources in the early Universe, and therefore contribute to the heating and reionisation of the intergalactic medium.