A novel adaptive sliding mode control design is developed for trajectory tracking of a class of flexible robots in this paper. This control design uses a force/position controller for robots with flexible joints where the friction between the end effector and the environment is taken into account. For systematic reasons the controller is designed considering the rigid links subsystem and the flexible joints. The proposed control system, satisfies the stability of the two subsystems and cope with the uncertainty of the robot dynamics. Finally simulation results are given to demonstrate the effectiveness of the proposed controller.