The control objectives in this paper are to move the gantry of a container crane to its target position and to suppress the transverse vibration of the payload. The crane system is modeled as an axially moving nonlinear string, in which control inputs are applied at both ends, through the gantry and the payload. The dynamics of the moving string are derived using Hamilton's principle. The Lyapunov function method is used in deriving a boundary control law, in which the Lyapunov function candidate is introduced from the total mechanical energy of the system. The performance of the proposed control law is compared with other two control algorithms available in the literature. Experimental results are given.