One dimensional systems strongly enhance the quantum character of electron transport. Such systems can be realized in 5d transition metals Au, Pt and Ir, in the form of suspended monatomic chains between bulk leads. Atomic chains between ferromagnetic leads would open up many perspectives in the context of spin-dependent transport and spintronics, but the evidence suggests that for pure metals only the mentioned three 5d metals are susceptible to chain formation. It has been argued that the stability of atomic chains made up from ferromagnetic metals is compromised by the same exchange interaction that produces the local moments. Here we demonstrate that magnetic atomic chains can be induced to form in break junctions under the influence of light molecules. Explicitly, we find deuterium assisted chain formation in the 3d ferromagnetic transition metals Fe and Ni. Chain lengths up to eight atoms are formed upon stretching the ferromagnetic atomic contact in deuterium atmosphere at cryogenic temperatures. From differential conductance spectra vibronic states of D$_2$ can be identified, confirming the presence of deuterium in the atomic chains.