The present invention relates to a method of precipitation of metal ions. Mineral(s), oxide(s), hydroxide(s) of magnesium and/or calcium are adopted as raw materials, and the raw material(s) is processed through at least one step of calcination, slaking, or carbonization to produce aqueous solution(s) of magnesium bicarbonate and/or calcium bicarbonate, and then the solution(s) is used as precipitant(s) to deposit rare earth, such as nickel, cobalt, iron, aluminum, gallium, indium, manganese, cadmium, zirconium, hafnium, strontium, barium, copper and zinc ions. And at least one of metal carbonates, hydroxides or basic carbonates is obtained, or furthermore the obtained products are calcined to produce metal oxides. The invention takes the cheap calcium and/or magnesium minerals or their oxides, hydroxides with low purity as raw materials to instead common precipitants such as ammonium bicarbonate and sodium carbonate etc. The calcium, magnesium, carbon dioxide etc are efficiently and circularly used, and the environment pollution by ammonium-nitrogen wastewater, high concentration salts wastewater is avoided, and both of the discharge of greenhouse gas carbon dioxide and the production cost of metal are decreased.