In this paper, mathematical model, control law design, different locomotion patterns, and locomotion planning are presented for an Anguilliform robotic fish. The robotic fish, consisted of links and joints, are driven by torques applied to the joints. Considering kinematic constraints, Lagrangian formulation is used to obtain the mathematical model of the robotic fish. The model reveals the relation between motion of the fish and external forces. Computed torque control method is first applied, which can provide satisfactory tracking performance for reference joint angles. To deal with parameter uncertainties, sliding model control is adopted. Three locomotion patterns — forward locomotion, backward locomotion, and turning locomotion — are realized by assigning appropriate reference angles to the joints, and the three locomotions are verified by experiments and simulations. A new form of central pattern generator (CPG) model is presented, which consists of three-dimensional coupled Andronov–Hopf oscillators, artificial neural network, and outer amplitude modulator. By using this CPG model, swimming pattern of a real Anguilliform fish is successfully applied to the robotic fish in an experiment.