This study investigates soil heavy metal contamination behind the green belts along National Highway 107 in China. Soil samples were collected from both sides of the highway to determine the concentrations of heavy metals such as copper, cadmium, chromium, lead, and zinc. The distribution patterns, ecological risks, and health hazards associated with these heavy metals were analysed. In order to provide more sample examples and data support for soil heavy metal pollution control. Inductively Coupled Plasma Mass Spectrometry (ICP-MS) was employed to detect the concentrations and speciation of these five heavy metals in the soil samples. The Geo-Accumulation Index method, the Nemerow pollution index method, and a health risk assessment model were used to evaluate the ecological and health risks of heavy metal pollution adjacent to the highway. Results indicated that: (1) The concentrations of Cu, Cd, Cr, Pb, and Zn in the soil decreased with the increasing number of protective forest layers, highlighting the significant role of protective belts in impeding the migration of heavy metals from the highway. (2) In terms of pollution assessment, the Geo-accumulation index method revealed prominent Cd contamination, the Geo-accumulation index of Cd peaked at 1.95 indicating a moderate to mild pollution level overall. Conversely, the Nemerow index method suggested a medium to extremely high risk of soil heavy metal Cd contamination. Specifically, the peak value of Cd single-factor pollution index in the study area reached 5.78, and the mean value of its Nemerow index (P) was 4.67. (3) In health risk assessment, it was found that children are more susceptible to heavy metal threats. The non-carcinogenic risk indices of all five heavy metals were less than 1, implying minimal risk. However, the total carcinogenic risk index for Cr ranged between 10–
6 and 10–4, posing a certain level of carcinogenic risk to humans.