A method of recovering copper and cobalt from a starting material comprising them, wherein the method comprises a) leaching in a leaching step the starting material in a leach solution to obtain a leach slurry comprising copper, cobalt, iron and aluminium, b) optionally subjecting the leach slurry to a first solid-liquid separation step for separating a solid leach residue from a liquid phase, c) extracting in a first extraction step a first part of copper from the liquid phase to obtain a main stream of copper and a liquid phase comprising iron, aluminium, cobalt and a second part of copper, d) contacting in a precipitation step the liquid phase comprising iron, aluminium, cobalt and the second part of copper with precipitating agent for precipitating iron, aluminium, cobalt and the second part of copper present in the liquid phase to obtain a slurry comprising precipitate, e) subjecting the slurry comprising the precipitate to a second solid-liquid separation step for separating the precipitate to obtain solid precipitate and a solution comprising the remaining cobalt and the remaining second part of copper, and optionally recycling the separated precipitate to the leaching step a), f) extracting in a second extraction step the remaining cobalt and the remaining second part of copper from the solution comprising them, wherein the solution is contacted with an extraction agent comprising hydroxyoxime and phosphinic acid to obtain an aqueous solution and an organic solution, in which organic solution copper is extracted into hydroxyoxime and cobalt is extracted into phosphinic acid, g) stripping cobalt from the organic solution into cobalt electrolyte solution, and h) stripping copper from the organic solution into copper electrolyte solution. a) leaching in a leaching step the starting material in a leach solution to obtain a leach slurry comprising copper, cobalt, iron and aluminium, b) optionally subjecting the leach slurry to a first solid-liquid separation step for separating a solid leach residue from a liquid phase, c) extracting in a first extraction step a first part of copper from the liquid phase to obtain a main stream of copper and a liquid phase comprising iron, aluminium, cobalt and a second part of copper, d) contacting in a precipitation step the liquid phase comprising iron, aluminium, cobalt and the second part of copper with precipitating agent for precipitating iron, aluminium, cobalt and the second part of copper present in the liquid phase to obtain a slurry comprising precipitate, e) subjecting the slurry comprising the precipitate to a second solid-liquid separation step for separating the precipitate to obtain solid precipitate and a solution comprising the remaining cobalt and the remaining second part of copper, and optionally recycling the separated precipitate to the leaching step a), f) extracting in a second extraction step the remaining cobalt and the remaining second part of copper from the solution comprising them, wherein the solution is contacted with an extraction agent comprising hydroxyoxime and phosphinic acid to obtain an aqueous solution and an organic solution, in which organic solution copper is extracted into hydroxyoxime and cobalt is extracted into phosphinic acid, g) stripping cobalt from the organic solution into cobalt electrolyte solution, and h) stripping copper from the organic solution into copper electrolyte solution.