The electronic properties of lanthanide (from Eu to Tm) impurities in wurtzite gallium nitride and zinc oxide were investigated by first principles calculations, using an all electron methodology plus a Hubbard potential correction. The results indicated that the 4f-related energy levels remain outside the bandgap in both materials, in good agreement with a recent phenomenological model, based on experimental data. Additionally, zinc oxide doped with lanthanide impurities became an n-type material, showing a coupling between the 4f-related spin polarized states and the carriers.This coupling may generate spin polarized currents, which could lead to applications in spintronic devices. [2,3] devices. Rare earth lanthanide atoms exhibit partially filled 4f shells, and intra-4f electric dipole transitions are forbidden for the free ions. On the other hand, the respective transition probabilities increase considerably when the ions are placed in a crystal field, that splits the 4f-related energy levels, modifying the dipole selection rules and leading to luminescent centers [4].Although theoretical modeling has been used to investigate the properties of RE-related materials [5,6], several methodological challenges have hindered an appropriate description of the 4f-related states in crystalline environments, such as RE impurities in semiconductors.It is well documented that the density functional theory generally fails in describing highly correlated systems, such as the interactions in 4f-related electronic states. Such limitations could in part be overcome with the introduction of an on-site Hubbard U potential correction [7][8][9]. One of the major outcomes of this correction is a better description of the energy splitting between occupied and unoccupied 4f-related electronic levels. We have recently shown that this procedure provides a good description of the electronic structure of metallic RE crystals [10], when compared to available experimental data [11]. Here, we show that the same procedure is also appropriate to describe the trends on the 4f-related energy levels of RE impurities (from Eu to Tm), with respect to the bandgap, in wurtzite gallium nitride and zinc oxide crystals. The results were discussed in the context of a recent phenomenological model to determine the energy positions of 4f-related electronic systems in crystalline environments [12]. Our results also indicate that doping ZnO with lanthanide impurities leads to a ntype material, with a magnetic coupling between the 4f-related states and the carriers.This suggests that such systems could generate spin polarized carrier currents, allowing to envision potential applications in spintronic devices.In RE lanthanide atoms, the 4f states play a minor role on bonding, staying in an atomiclike configuration. Therefore, those atoms bind to their neighboring ones through their outer (5d, 6s, and 6p) atomic valence states [11]. Earlier theoretical investigations generally considered the 4f electrons as core states, with constrained occupations ...