Method for extracting a metal ion M from a medium, comprising the steps of: a) contacting an ionic liquid of formula C +,(X p-) 1/p, in which: - C + is an onium cation comprising at least one atom selected from N, S, P or O, the onium cation comprising at least one hydrocarbon chain R 1 comprising from 6 to 20 carbon atoms, optionally interrupted by one or more groups selected from -S-, -O-, - (C=O)-O-, -O-(C=O)-, -NR 10 -(C=O)-, -(C=O)-NR 11 - or -NR 12 R 13 -, and/or optionally substituted with one or more groups selected from halogen, -OR 14, -(C=O)R 15, - (C=O)NR 16 R 17 -, - NR 18 R 19 R 20, -S-R 21, -(C=O)-OR 22, wherein R 10, R 11, R 12, R 13, R 14, R 15, R 16, R 17, R 18, R 19, R 20 and R 21 independently represent H or a linear or branched hydrocarbon chain comprising from 1 to 6 carbon atoms and R 22 represents a linear or branched hydrocarbon chain comprising from 1 to 6 carbon atoms, and - X p- is an anion of charge p, said ionic liquid having a solubility in water at 20°C of at least 10 g/L, with an aqueous medium comprising a metal ion M and an acid, whereby a composition is obtained at a temperature T i, said composition comprising a single liquid phase, b) varying the temperature to obtain a composition at a temperature T f different from T i comprising two liquid phases φ IL and φ W, the liquid phase φ IL being a phase enriched in ionic liquid and the liquid phase φ W being a phase enriched in water, of which the pH is less than or equal to 4.7, with the proviso that, at the temperature T f, the partition coefficient of the metal ion between the two phases φ IL and φ W: K M Tf = M φ IL / M φ W in which φIL is the concentration in M in the phase φ IL at the temperature T f and φ W is the concentration in M in the phase φ W at the temperature T f, is greater than 1, preferably greater than 1.1, especially greater than 2, even greater than 5, especially greater than 10, typically greater than 100, c) separating the phases φ IL and φ W of the composition obtained in step b), then d) optionally extracting the metal ion M from the phase φ IL. a) contacting an ionic liquid of formula C +,(X p-) 1/p, in which: - C + is an onium cation comprising at least one atom selected from N, S, P or O, the onium cation comprising at least one hydrocarbon chain R 1 comprising from 6 to 20 carbon atoms, optionally interrupted by one or more groups selected from -S-, -O-, - (C=O)-O-, -O-(C=O)-, -NR 10 -(C=O)-, -(C=O)-NR 11 - or -NR 12 R 13 -, and/or optionally substituted with one or more groups selected from halogen, -OR 14, -(C=O)R 15, - (C=O)NR 16 R 17 -, - NR 18 R 19 R 20, -S-R 21, -(C=O)-OR 22, wherein R 10, R 11, R 12, R 13, R 14, R 15, R 16, R 17, R 18, R 19, R 20 and R 21 independently represent H or a linear or branched hydrocarbon chain comprising from 1 to 6 carbon atoms and R 22 represents a linear or branched hydrocarbon chain comprising from 1 to 6 carbon atoms, and - X p- is an anion of charge p, said ionic liquid having a solubility in water at 20°C of at least 10 g/L, with an aqueous medium comprising a metal ion M and an acid, whereby a composition is obtained at a temperature T i, said composition comprising a single liquid phase, - C + is an onium cation comprising at least one atom selected from N, S, P or O, the onium cation comprising at least one hydrocarbon chain R 1 comprising from 6 to 20 carbon atoms, optionally interrupted by one or more groups selected from -S-, -O-, - (C=O)-O-, -O-(C=O)-, -NR 10 -(C=O)-, -(C=O)-NR 11 - or -NR 12 R 13 -, and/or optionally substituted with one or more groups selected from halogen, -OR 14, -(C=O)R 15, - (C=O)NR 16 R 17 -, - NR 18 R 19 R 20, -S-R 21, -(C=O)-OR 22, wherein R 10, R 11, R 12, R 13, R 14, R 15, R 16, R 17, R 18, R 19, R 20 and R 21 independently represent H or a linear or branched hydrocarbon chain comprising from 1 to 6 carbon atoms and R 22 represents a linear or branched hydrocarbon chain comprising from 1 to 6 carbon atoms, and - X p- is an anion of charge p, said ionic liquid having a solubility in water at 20°C of at least 10 g/L, b) varying the temperature to obtain a composition at a temperature T f different from T i comprising two liquid phases φ IL and φ W, the liquid phase φ IL being a phase enriched in ionic liquid and the liquid phase φ W being a phase enriched in water, of which the pH is less than or equal to 4.7, with the proviso that, at the temperature T f, the partition coefficient of the metal ion between the two phases φ IL and φ W: K M Tf = M φ IL / M φ W in which φIL is the concentration in M in the phase φ IL at the temperature T f and φ W is the concentration in M in the phase φ W at the temperature T f, is greater than 1, preferably greater than 1.1, especially greater than 2, even greater than 5, especially greater than 10, typically greater than 100, c) separating the phases φ IL and φ W of the composition obtained in step b), then d) optionally extracting the metal ion M from the phase φ IL.