We report the propagation dynamics of swallowtail beams (SBs) within a photorefractive crystal. In the nonlinear regime, the self-accelerating and secondary self-focusing features of the swallowtail beams are influenced, and a solitary wave is generated. The main lobe energy of the swallowtail beams is guided to a specific inclined trajectory, leading to a stable solitary wave, and we control the output position of the solitary wave by changing the launch angle. Our results are supported by the corresponding experiments. In addition, we demonstrate that a Gaussian beam can be effectively guided in swallowtail optical waveguide structures. Our research represents an interesting interaction between the swallowtail beams and nonlinear medium, which may find potential applications in photonic integrated devices and optical information transmission.