To simultaneously achieve space formation flight and target tracking of multiple unmanned aerial vehicles (UAVs) and solve the rotation buffeting problem of the UAV, a robust formation control and target tracking algorithm is proposed. The artificial potential function consisting of formation control term and target tracking term is established, and its convergence is proved. The sliding mode control method with the saturation function is established, and a sufficient condition for sliding mode to occur is analysed. Finally, the numerical simulation is conducted for the proposed algorithm, and the simulation result is analysed. The results show that the proposed algorithm can quickly achieve the formation flight and target tracking of multi-UAVs and improve the tracking performance; meanwhile, it can effectively weaken the rotation buffeting and improve the robustness.