Phosphorus (P) is a non-regenerative and finite raw material. Due to its decreasing availability, and to protect the environment, recycling methods are needed. With the focus on closing nutrient cycles, sewage sludge (SS) is a potential source for P recovery. The objective of this study was to produce a mineral P-reach fertilizer. For this purpose, the treatment of SS in a multi-stage process, consisting of a hydrothermal carbonization (HTC) and thermochemical post-treatment was examined and compared with a direct thermochemical treatment. The focus was on the transformation of P and the migration of the heavy metals during the processes. In addition, the role of MgCl2 as an additive was examined. During the HTC, most of the P remained in the HTC-char, so that the P content increased in the HTC-char compared with the SS. The addition of MgCl2 to the process resulted in lower transportation rates of P in the liquid phase and higher P solubilities in water, citric acid, and alkalic ammonium citrate out of the solid phase. The thermochemical treatment of SS and the HTC-chars further concentrated P in the ash. Retention rates of >97% were achieved, and P2O5 contents in the ash were as high as similar to 16 wt-%. The presence of the additive resulted in (i) higher retention rates of P in the ashes (ii) higher P-solubility and (iii) higher removal rates of easily volatile heavy metals such as Pb and Zn, and the treatment of HTC-char favored these effects compared with the direct treatment of SS.