In this paper, we present an approach to imitation learning of arm movements in humanoid robots. Continuous hidden Markov models (HMMs) are used to generalize movements demonstrated to a robot multiple times. Characteristic features of the perceived movement, so-called key points, are detected in a preprocessing stage and used to train the HMMs. For the reproduction of a perceived movement, key points that are common to all (or almost all) demonstrations, so-called common key points, are used. These common key points are determined by comparing the HMM state sequences and selecting only those states that appear in every sequence. We also show how the HMM can be used to detect temporal dependencies between the two arms in dual-arm tasks. Experiments reported in this paper have been performed using a kinematics model of the human upper body to simulate the reproduction of arm movements and the generation of natural-looking joint configurations from perceived hand paths. Results are presented and discussed.