Fluid-conveying pipes are widely used in marine engineering, aerospace, advanced manufacturing, biomedicine and other engineering industries and frontier science and technology. Under the action of the internal fluid flow, the soft pipe may lose stability and is easy to generate large displacement. Therefore, it is of importance to predict the pipe’s stability and regulate its mechanical behavior. Based on Hamilton’s principle, a theoretical model of hard-magnetic soft pipes under the actuation of the external magnetic field is proposed, the governing equation for a simply supported pipe with an axially sliding downstream end is derived. By employing the Galerkin method, the buckling instability of the pipe system is analyzed, and the magnetic regulation of the buckling deformation behavior of the pipe is realized. The calculated results show that when the flow velocity is below the critical value, the fluid-conveying pipe remains stable at the original straight configuration. When the flow velocity exceeds the critical value, the buckling instability occurs in the form of a static bifurcation. By solving the nonlinear governing equation of the pipe system, the nonlinear mechanical response of the pipe is obtained. It is shown that the magnetic field force magnitude P
and the magnetic declination angle α
together affect the nonlinear mechanical response of the pipe system. The value of α
determines the evolution trend of the critical flow velocity and the pipe’s deformed bending shape with the change of the value of P
. The proposed theoretical model can be extended to investigate the mechanical response of non-uniformly magnetized soft pipes. The magnetic field regulation method adopted in this work has the advantages of non-contact and rapid response, and is expected to be further applied in the fields of medical devices and extreme environment operations.