The recovery of rare-earth metals from waste materials is very important due to the risks associated with having a low supply of them in the future. In this work, hydrophobic 1alkylcarboxylic acid-3-methylimidazolium bis(trifluoromethylsulfonyl)imide ionic liquids, [(CH 2 ) n COOHmin][Tf 2 N] (n = 3, 5, 7), were synthesized and used to separate neodymium (III) from Fe(III) and samarium (III) from Co(II) in aqueous solutions. The factors affecting the solvent extraction process such as phase volume ratio, contact time, pH value of the aqueous phase, alkyl chain length of the ionic liquids, and temperature of the system were examined systematically. It was found that the maxmium extraction efficiency of the investigated metal ions was as high as 99%, and Sm(III) and Nd(III) could be selectively separated from Co(II) and Fe(III), with separation factors of 10 4 −10 5 , by simply modulation of the aqueous phase pH. After extraction, about 97% of the metal ions could be stripped from ionic liquid phase in a single stripping step by using dilute aqueous HCl or oxalic acid, and the ionic liquids would be recovered and reused in the next extraction process. These results indicate that the ionic liquids developed here are useful for the selective recovery of rare-earth metals from NdFeB and SmCo permanent magnets.