As the extension of the linear inverted pendulum ( LIP ) and planar inverted pendulum ( PIP ) , this paper proposes a novel spatial inverted pendulum ( SIP ) . The SIP is the most general inverted pendulum ( IP ) than any existing IP. The model of the SIP is presented for the first time. The SIP inherits all the characteristics of the LIP and the PIP, which is a nonlinear, unstable and underactuated system. The SIP has five degrees of motion freedom and three control forces. Thus, it is a multiple-input and multiple-output ( MIMO ) system with nonlinear dynamics. To realize the spatial trajectory tracking of the SIP, the control structure with five PID controllers will be designed. The parameter tuning of the multiple PIDs is a challenging work for the proposed SIP model. To alleviate the difficulties of the parameter tuning for the multiple PID controllers, optimal PIDs can be achieved with the help of Big Bang-Big Crunch ( BBBC ) optimization. The BBBC algorithm can successfully optimize the parameters of the multiple PID controllers with high convergence speed. The optimization performance index of the BBBC algorithm is compared with that of the particle swarm optimization ( PSO ) . Simulation results certify the rightness and effectiveness of the proposed control and optimization methods.