First, the internal model principle is applied for plants that are passive nonlinear systems, to solve a disturbance rejection problem (without reference signal), where the exogeneous signal is a finite superposition of sine waves of arbitrary known frequencies. The proposed controller assures that both the state of the plant and the error signal converge to zero. Based on the above result, we solve the tracking and disturbance rejection problem for a class of fully actuated passive mechanical systems. Here, we combine our first result with the ideas behind the Slotine-Li controller.We assume that the reference signal r and its first two derivatives are available to the controller. The internal model-based compensator that we propose causes the tracking error to converge to zero.