A surgical stapler including a safety apparatus, including: a stapler part, a fixed handle, a safety apparatus, a transmission assembly, a propulsion assembly, and a trigger handle. The safety apparatus includes a safety piece and a fixing block. The propulsion assembly includes an ejector sleeve. The safety apparatus is fixed on the propulsion assembly and contacts with a surface of the transmission assembly. The safety piece is disposed inside the fixing block. At least one spring is disposed inside the fixing block to ensure elasticity of the safety piece.