Context. 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. Aims. 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. Methods. We introduce the relativistic neutron component through a coupling term in the transport equation that governs the jet proton population. We compute the escape rate and decay distribution of these neutrons, and follow the propagation of the decay products until they escape the system and become cosmic rays. We then compute the spectra of these cosmic rays. Results. Neutrons can drain only a small fraction of the jet power as cosmic rays. The most promising scenarios arise in extremely luminous systems (L jet ∼ 10 40 erg s −1 ), in which the fraction of jet power deposited in cosmic rays can reach ∼ 0.001. Slow jets (Γ 2, where Γ 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 ∼ 3) above this energy, and almost flat below. Conclusions. The proposed mechanism produces more energetic cosmic rays from microquasars than those presented by previous works in which the particles escape through the jet terminal shock. 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.