In this paper, a nonlinear robust optimal controller is designed for an active transfemoral prosthesis using sliding mode control and state-dependent Riccati equation control. In this method, unlike most nonlinear control methods, the Jacobian approach is not used for model linearization and system's state space equations are used directly. This is a reason for the accuracy and flexibility of the proposed controller in design compared to other conventional methods. Since the proposed approach is energy-driven, the main objective of this research is to optimize the energy consumption of the robot/prosthesis system, reduce the effects of disturbances, noise, and parametric uncertainties, and desirable trajectory tracking of the vertical displacement in hip and thigh and knee angles. To this aim, the integral state control technique and the boundary layer are used for reconciliation between tracking performance and control signal chattering. In this study, the performance of the controller is assessed for nominal system and uncertain system with ± 30% parameters’ uncertainty by considering the saturation bounds of control signals. The simulation results demonstrate a decrease in the control effort, good robustness in the presence of uncertainty, and desirable tracking performance compared to a robust adaptive impedance control approach.