Here we report on controlling the effective hybridization and charge transfer of rare-earth elements inside a carbon nanotube (CNT) nanoreactor. The tubular space inside CNTs can encapsulate one-dimensional (1D) crystals such as ErCl 3 , which we have used as a starting material. Applying a thermochemical reaction in ultrahigh vacuum, we obtain elemental Er nanowires still encapsulated in the CNTs. The hybridization degree and the effective charge changes were directly accessed across the Er 4d and 3d edges by high-energy spectroscopy. It was found that Er is trivalent but the effective valence is reduced for the Er-filled tube, which strongly suggests an increased hybridization between the nanotube π states and the Er 5d orbitals. This was also evidenced by the conduction band response determined in C1s-x-ray absorption spectroscopy (XAS). These results have significant implications for the 1D electronic and magnetic properties of these and similar rare-earth nanowire hybrids.