An inverse dynamics control algorithm for constrained flexible-joint robots is developed. It is shown that in a flexible-joint robot, the acceleration level inverse dynamic equations are singular because of the elastic media. Implicit numerical integration methods that account for the higher order derivative information are utilized for solving the singular set of differential equations. The control law proposed linearizes and decouples the system and achieves simultaneous and asymptotically stable trajectory tracking control of the end-effector motion and contact forces. Together with the integrators for improving robustness due to modelling errors and disturbances, a fifth order position error dynamics and a third order contact force error dynamics are obtained. A 3R spatial robot with all joints flexible is simulated to illustrate the performance of the method. (C) 1999 Academic Press.