In this paper, a variable gain prescribed performance control law is proposed for dynamic positioning (DP) of ships with positioning error constraints, input saturation and unknown external disturbances. The error performance index functions are designed to preset the prescribed performance bounds and the error mapping functions are constructed to incorporate the prescribed performance bounds into the DP control design. The variable gain technique is used to limit the output amplitude of the control law to avoid input saturation of the system by dynamically adjusting the control gain of the DP control law according to the positioning errors, and the error mapping function replaces the positioning error as a recursive sliding-mode surface to realize the prescribed performance control of the system and guarantee the stability of the closed-loop system with variable control gains. It has been proved that the proposed DP control law can make the uniformly ultimately boundedness of all signals in the DP closed-loop control system. The numerical simulation results illustrate that the proposed control law can make the ship’s position and heading maintain at the desired value with positioning error constraints, enhance the non-fragility of the DP control law to the perturbation of system’s parameters and improve the system’s rejection ability to external disturbances.