The aim of the work is to study the effectiveness of a molecular imprinting technique application for the creation of highly selective macromolecular sorbents for selective sorption of light and heavy rare-earth metals (for example, samarium and gadolinium, respectively) with subsequent separation from each other. These sorbents seem to be promising due to the fact that only the target rare-earth metal will be sorbed owing to the fact that complementary cavities are formed during the synthesis of molecularly imprinted polymers. In other words, the advantage of the proposed macromolecules is the absence of accompanying sorption of metals with close chemical properties. Two types of molecularly imprinted polymers (MIP) were synthetized based on methacrylic acid (MAA) and 4-vinylpyridine (4VP) functional monomers. The sorption properties (extraction degree, exchange capacity) of the MIPs were studied. The impact of template removal cycle count (from 20 to 35) on the sorption effectivity was studied. Laboratory experiments on selective sorption and separation of samarium and gadolinium from a model solution were carried out.