A novel Immune Genetic Algorithm with Elitism (IGAE) is presented. The IGAE has two features. The first is that the similarity and expected reproduction probability of antibody can be adjusted dynamically in the process of population evolution to balance the population diversity and the convergence speed of the algorithm. The second is that with the elitism strategy this algorithm is able to find the globally optimal solution. Based on the IGAE, an optimal design method of PID controller is proposed. The PID controller designed by the IGAE, called the IGAE-PID controller, was used to control the motion of the CIP-I leg, an intelligent leg prosthesis. The simulation experiments demonstrated that the controller has good control performance. Compared with the other three PID controllers designed respectively by the immune clonal selection algorithm, the canonical genetic algorithm with the elitism strategy, and the standard simulated annealing algorithm, the IGAE-PID controller exhibited better or equivalent control performance. Moreover, the simulation results also verified that the IGAE has better performance in convergence speed and computation efficiency.