The robotics field of engineering has been witnessing ra advancements and becoming widely engaged in our lives recently. Its application has pervaded various areas that range from household services to agriculture, industry, military, and health care. The humanoid robots are electro–mechanical devices that are constructed in the semblance of humans and have the ability to sense their environment and take actions accordingly. The control of humanoids is broken down to the following: sensing and perception, path planning, decision making, joint driving, stability and balance. In order to establish and develop control strategies for joint driving, stability and balance, the triple inverted pendulum is used as a benchmark. As the presence of uncertainty is inevitable in this system, the need to develop a robust controller arises. The robustness is often achieved at the expense of performance. Hence, the controller design has to be optimized based on the resultant control system’s performance and the required torque. Particle Swarm Optimization (PSO) is an excellent algorithm in finding global optima, and it can be of great help in automatic tuning of the controller design. This paper presents a hybrid H∞/sliding mode controller optimized by the PSO algorithm to control the triple inverted pendulum system. The developed control system is tested by applying it to the nominal, perturbed by parameter variation, perturbed by external disturbance, and perturbed by measurement noise system. The average error in all cases is 0.053 deg and the steady controller effort range is from 0.13 to 0.621 N.m with respect to amplitude. The system’s robustness is provided by the hybrid H∞/sliding mode controller and the system’s performance and efficiency enhancement are provided by optimization.