Biochar is a popular material that would effectively immobilize heavy metals in soil, which can greatly decrease the health risk of heavy metals. Although many previous studies have studied the immobilization of heavy metals by biochar, the influence of hydrological conditions on the immobilization effect is still not clear. This paper carried out column experiments to study the effect of fluctuating groundwater table on Cu, Ni, Pb, Zn distribution and speciation with the addition of biochar from pyrolysis of swine manure. Experimental results showed that biochar could significantly decrease the leaching toxicity of Cu and Ni by 24.4% and 44.7% respectively, while the immobilization effect of Pb and Zn was relatively insignificant. The average reduction percentage of bioavailable Cu was 14.5%, 39.5% and 33.3% in the unsaturated zone, fluctuating zone and saturated zone respectively, showing the better immobilization effect in the fluctuating zone and saturated zone. The residual fraction of heavy metals increased significantly after the addition of biochar, and the increase of residual fraction was larger in small soil aggregates. This study helped illustrate the influence of hydrological conditions and soil aggregate sizes on the stabilization effect of heavy metals by biochar, which could be used to guide the remediation process of sites contaminated by heavy metals. • Hydrological conditions could affect availability and speciation of heavy metals. • Biochar could decrease mobility of Cu and Ni more significantly than Pb and Zn. • The immobilization effect was significant in the fluctuating and saturated zones. • The increase of residual fraction was more significant in small soil aggregates.