The flow accelerated corrosion of H 2 S media widely exists in chemical equipment and chemical pipe fittings. It can lead to equipment failure and cause safety accidents. In this paper, ultrasonic shot peening (USSP) was used to realize surface nanocrystallization of the 5Cr–0.5Mo steel specimens. It was found that strong plastic deformation occurred on the surface of the specimen, and dense nanoscale corrosion product film was formed. A closed flow accelerated corrosion test device with H 2 S media was used to test the corrosion of the specimens. The experimental results showed that the corrosion current density of the specimen was decreased, the corrosion potential was increased, and the corrosion resistance was enhanced. However, with the increase of USSP duration, the density of the corrosion product film formed on the surface of the specimen was decreased, and the corrosion rate of the specimen was increased.