We present an approach for kinesthetic teaching of motion primitives for a humanoid robot. The proposed teaching method starts with observational learning and applies iterative kinesthetic motion refinement using a forgetting factor. Kinesthetic teaching is supported by introducing the motion refinement tube, which represents an area of allowed motion refinement around the nominal trajectory. On the realtime control level, the kinesthetic teaching is handled by a customized impedance controller, which combines tracking performance with compliant physical interaction and allows to implement soft boundaries for the motion refinement. A novel method for continuous generation of motions from a hidden Markov model (HMM) representation of motion primitives is proposed, which incorporates time information for each state. The proposed methods were implemented and tested using DLR's humanoid upper-body robot Justin.An earlier version of this work was presented at the IEEE/RSJ Int.