Resource utilization of sludge is critical because traditional sludge treatment methods cause a large amount of nutrient loss. This study investigated the impact of hydrochloric acid quantity, reaction temperature, and time on phosphorus release and migration from municipal sludge during hydrothermal treatment and designed a sludge disposal method for the recovery and utilization of phosphorus resources. We know that hydrochloric acid destroys the complexation of calcium and phosphorus precipitates, leading to the selective transfer of phosphorus to the liquid phase, and that the addition of 1–5% hydrochloric acid corresponds to a phosphorus extraction rate in the range of 0.3–98%. When hydrochloric acid is added, a change in temperature and reaction time has a negligible effect on phosphorus. Phosphorus can be recovered using the liquid product obtained under the optimal hydrothermal reaction conditions (adding 5% HCl at 205 °C for 30 min). After adjusting the pH value and adding the magnesium source, struvite (MgNH4PO4·6H2O) can be precipitated quickly and with high purity. At a cost of USD 27.8/ton of sludge, this method can recover 94% of the phosphorus in the sludge, and the bioavailable phosphorus ratio of the product is 93%, therefore, providing an important alternative to existing phosphorus recovery technologies.