In this study, an ionic liquid-based polymer inclusion membrane (IL-PIM) made of (50% polymer-50% CyphosIL104) was used to extract and separate the rare earth elements (REEs) Y, La, Nd, and Sm in chloride solutions. The effect of extraction time and pH was studied to optimize the extraction and separation conditions. The four REEs were effectively extracted at pH 4–5 from both single and mixed metals solutions. However, at pH 2, only Y was extracted. The recovery of the extracted REEs from the loaded PIM was achieved using HNO3 and H2SO4. In the case of La, it was quantitatively back-extracted with H2SO4 after a contact time of 1 h, while up to 4 h was necessary to recover 70% of the extracted Y, Sm, and Nd. Extraction isotherms were studied, and the Freundlich isotherm model was the most adequate to describe the interaction between the PIM and the REEs. Finally, the developed PIM was investigated for the extraction of REEs from mixtures containing other metals, which showed great selectivity for the REEs.