In this article control-based reduction of gantry crane elastic swinging in the trolley travel direction is concerned. As acceleration forces of the trolley are often the reason of these vibrations, they can be utilized in an appropriate damping strategy. For an elastic crane a dynamic model is derived applying the finite element method (FEM). This approach results in a high order state-space model, which should be reduced for the controller design procedure. In order to design a controller, which can be applied for simultaneous damping of elastic vibrations of crane construction and payload sway with varying rope length a robust control approach has been applied.