Objective As pH is a key factor affecting the migration and release of nutrients in the ditch sediment, this study, with an investigation of the dynamic changes of nutrient release and migration in the bottom mud of mountainous rural ditches under different pH conditions, is aimed to provide a theoretical basis for rural ecological environment management. Method With the bottom mud of typical mountainous rural ditches in the Dianchi Lake Basin collected, indoor simulation experiments were conducted to determine the nutrient salt content of the bottom mud and the overlying water under different pH (pH 5.5, 7.5, 9.5, 11.5) conditions under non-sterilized and sterilized treatments after which the nutrient release flux at the sediment-water interface was estimated. Result The mass fraction of total nitrogen (TN) in the bottom sludge decreased with the increase of pH. The total nitrogen release flux under the strong alkaline (pH 11.5) and acidic (pH 5.5) conditions of the non-sterilized group was 8 and 4 times of the control (pH 7.5), and its release flux in the sterilization group was 2 times of that in the control. The mass concentration and release flux of soluble total phosphorus (DTP) in the overlying water increased with the increase of pH. The release of DTP under the conditions of strong alkaline (pH 11.5) and weak alkaline (pH 9.5) in the non-sterilized group was 12 and 4 times of that in the control, respectively, and its release flux in the sterilized group was 30 and 15 times of that in the control while the non-sterilized group had higher DTP release flux than the sterilized group. RDA shows that acidic conditions promote the release of calcium-bound phosphorus (Ca-P) in sediments, and alkaline (pH≥9.5) conditions promote the release of total nitrogen, total phosphorus and iron-aluminum-bound phosphorus (Fe/Al-P). Neutral (pH 7.5) conditions have little effect on the release of nitrogen or phosphorus in the sediments. Conclusion Alkalinity (pH≥9.5) and acidity significantly promote the release of nitrogen and phosphorus nutrients in the bottom mud of mountain rural ditches, and the release amount is the smallest under neutral conditions. Also, the sterilization of the bottom sludge reduces the microbial activity at different pH levels, and prevents the migration and release of nitrogen and phosphorus in the bottom sludge of mountain and rural ditches to the overlying water. [Ch, 6 fig. 1 tab. 36 ref.]