The effect of boron (B) addition coupled with 500 ℃ pre-aging on the corrosion resistance of S31254 was systematically investigated. The results suggested that the diffusion of Mo to grain boundaries (GBs) played a crucial role in enhancing intergranular corrosion resistance. Additionally, the addition of B further promoted the uniform distribution of Mo during the pre-aging process by suppressing Mo segregation at GB. Ultimate, the B microalloying coupled with the pre-aging strategy optimized the composition of passive film through promoting the formation of Mo-rich passivation film, which significantly enhanced the corrosion resistance of Mo-containing stainless steel.