Modelling and identification of flexible-joint robots is required for dynamic simulation and model based control of industrial robots. A nonlinear finite element based method is used to derive the dynamic equations of motion in a form suitable for both simulation and identification. The latter requires that the equations of motion are linear in the dynamic parameters. For accurate simulations of the robot tip motion, the model should describe the relevant dynamic properties such as joint friction and flexibilities. Both the drive and the joint flexibilities are included in the model. Joint friction is described by means of a static friction model, including Coulomb and viscous friction components. The dynamic parameters describing mass, inertia, stiffness, damping and friction properties are obtained from a least squares solution of an over determined linear system assembled from closed loop identification experiments. In the identification experiment, the robot moves along a prescribed trajectory while all joint angles, flexible deformations and driving torques are recorded. To excite joint vibrations during the identification feed forward torques at frequencies above the bandwidth of the control system are superposed on the joint torques. The applicability of the method is demonstrated in a numerical study of a four-link industrial robot.