Abstract- Applying automatic control on gantry cranes to move loads with minimal sway angle is considered as a challenge due to the crane system uncertain parameters and a robust automatic control is needed. In this paper a sliding mode controller is applied to overcome the crane system uncertainties and achieve the desired performance. Some labor is spent to transform the system to the regular form and an error function is written depending on the transformed variables then a switching function in terms of the error function is constructed and a sliding mode controller is designed to make the error function reach zero so the crane moves to the specified displacement with minimum sway angle. Stability analyses are provided to show that the system is stable under the control we proposed. Simulations are held by software to validate the effectiveness of our work and prove that the proposed control is successful in giving our system the preferred behavior then Results are discussed and some point view is to be put.