Structural, electronic, and transport properties of Gd/Eu atomic chains encapsulated in single-walled carbon nanotubes (SWCNTs) are studied by using first-principles density functional theory and the nonequilibrium Green’s function method. We find that the linear single-atom Gd and Eu chains occupy an off-centered position when encapsulated in the (8,0), (10,0), and (6,6) SWCNTs and considerable electrons are transferred from the Gd and Eu chains to the SWCNTs. The resulting composites are all ferromagnetic metals, with the conductivity significantly larger than those of the pristine SWCNTs and the free-standing Gd/Eu linear single-atom atomic chains. The spin polarization of the finite Gd linear single-atom chain at the Fermi level is 67% when encapsulated in the (8,0) SWCNT from the quantum transport calculation.