A theoretical model for investigating the effect of the trapped energetic particles EPs on the resistive wall mode RWM instability is proposed. The results demonstrate that the trapped EPs have a dramatic stabilizing effect on the RWM because of resonant interaction between the mode and the magnetic precession drift motion of the trapped EPs. The results also show that the effect of the trapped EPs depends on the wall position. In addition, the stabilizing effect becomes stronger when the plasma rotation is taken into account. For sufficiently fast plasma rotation, the trapped EPs can lead to the complete stabilization of the RWM. Furthermore, the trapped EPs can induce a finite real frequency of the RWM in the absence of plasma rotation. © 2011 American Institute of Physics .