A solvometallurgical process was developed to recover rare-earth elements and cobalt from end-of-life NdFeB magnets, using the ionic liquid (IL) trihexyltetradecylphosphonium trichloride ([P-666,P-14][Cl-3]), or a mixture of [P-666,P-14][Cl-3] and the corresponding chloride IL [P-666,P-14]Cl. The process comprises dissolution, stripping and regeneration of the ionic liquid. Pure [P-666,P-14][Cl-3] or its mixture with [P-666,P-14]Cl could quantitatively dissolve NdFeB magnets when the solid-to-liquid ratio was less than a certain threshold value that depended on the volume percentage of [P-666,P-14][Cl-3] in the lixiviant. Increasing the temperature from 25 to 50 degrees C enhanced the dissolution rate significantly, but the dissolution efficiency increased only marginally. The volume percentage of [P-666,P-14][Cl-3] in [P-666,P-14]Cl had a positive effect on the dissolution efficiency. The rare-earth and transition metals could be removed selectively by two sequential stripping steps, using 3 mol.L-1 of NaCl aqueous solution and >2 mol.L-1 of aqueous ammonia solutions, respectively. The regenerated IL [P-666,P-14][Cl-3] showed a similar dissolution efficiency to the fresh ionic liquid.