This paper describes a finite state machine to control an ankle-foot prosthesis with two degrees of freedom (DOF) in the sagittal and frontal planes. Strain gauges were installed in the foot to provide ground reaction torques feedback for impedance and admittance controllers to be used at heel-strike and push-off of the gait, respectively. The quasi-static stiffness of the ankle with the active control was measured showing a near linear relationship between the torque feedback gain and the stiffness of the ankle. The performance of the finite state machine and controllers were also evaluated using a custom-made circular treadmill and the results were compared to the results of the prosthesis using position controller and inactive controllers. The results showed that the impedance/admittance controller was capable of tracking the desired input trajectory while decreasing the required torque at the ankle joint.