A method of separating cobalt and magnesium from a nickel-bearing extraction feed solution with liquid-liquid extraction, wherein a first extraction solution contains, as an extraction reagent, a bis(2,4,4-trimethylpentyl)phosphinic acid, which is insoluble or poorly soluble in said feed solution, characterized in that the method comprises at least the following method stages enabling cobalt, magnesium and nickel to be separated into discrete aqueous solution streams: - in an extraction stage, the aqueous cobalt-, magnesium- and nickel-containing extraction feed solution is extracted with the first extraction solution containing as an extraction agent, a bis(2,4,4-trimethylpentyl)phosphinic acid, for providing a cobalt-, magnesium- and nickel-loaded second extraction solution and a primarily nickel-containing aqueous raffinate, - in a washing stage, the cobalt-, magnesium- and nickel-loaded second extraction solution is washed in a countercurrent fashion with a primarily cobalt- and sulfuric acid-containing first aqueous washing solution whose pH is 0,5-5, wherein said washing of second extraction solution comprises several washing steps whose target pH is 3-5, for providing a primarily cobalt- and magnesium-loaded third extraction solution and a primarily nickel-containing first wash water, - in a washing stage, the primarily cobalt- and magnesium-loaded third extraction solution is washed in a countercurrent fashion with a water-, cobalt- and sulfuric acid-containing second aqueous washing solution whose pH is 0,5-5 wherein said washing of third extraction solution comprises several washing steps whose target pH is 3-5, yet lower than in the washing steps of the washing stage for providing a primarily cobalt-loaded fourth extraction solution and a primarily magnesium-containing second wash water, and - in a back-extraction stage, the primarily cobalt-loaded fourth extraction solution is back-extracted with an aqueous solution of sulfuric acid or with an aqueous solution of some other mineral acid, i.e. with a back-extraction solution, whose acid content is 30-300 g/L, for providing a fifth extraction solution substantially free of metals and a primarily cobalt-containing aqueous product solution. - in an extraction stage, the aqueous cobalt-, magnesium- and nickel-containing extraction feed solution is extracted with the first extraction solution containing as an extraction agent, a bis(2,4,4-trimethylpentyl)phosphinic acid, for providing a cobalt-, magnesium- and nickel-loaded second extraction solution and a primarily nickel-containing aqueous raffinate, - in a washing stage, the cobalt-, magnesium- and nickel-loaded second extraction solution is washed in a countercurrent fashion with a primarily cobalt- and sulfuric acid-containing first aqueous washing solution whose pH is 0,5-5, wherein said washing of second extraction solution comprises several washing steps whose target pH is 3-5, for providing a primarily cobalt- and magnesium-loaded third extraction solution and a primarily nickel-containing first wash water, - in a washing stage, the primarily cobalt- and magnesium-loaded third extraction solution is washed in a countercurrent fashion with a water-, cobalt- and sulfuric acid-containing second aqueous washing solution whose pH is 0,5-5 wherein said washing of third extraction solution comprises several washing steps whose target pH is 3-5, yet lower than in the washing steps of the washing stage for providing a primarily cobalt-loaded fourth extraction solution and a primarily magnesium-containing second wash water, and - in a back-extraction stage, the primarily cobalt-loaded fourth extraction solution is back-extracted with an aqueous solution of sulfuric acid or with an aqueous solution of some other mineral acid, i.e. with a back-extraction solution, whose acid content is 30-300 g/L, for providing a fifth extraction solution substantially free of metals and a primarily cobalt-containing aqueous product solution.