U.S. Department of Energy (DOE) SciDAC GSEP Center; National Special Research Program of ChinaIn the present paper, we first derive the eigenmode equation of the ideal ballooning mode in tokamak plasmas using a gyrokinetic equation. It is shown that the gyrokinetic eigenmode equation can be reduced to the magnetohydrodynamic (MHD) form in the long wavelength limit when kinetic effects are ignored. Then, the global gyrokinetic toroidal code (GTC) is applied for simulations of the edge-localized ideal ballooning modes. The obtained mode structures are compared with the results of ideal MHD simulations. The observed scaling of the linear growth rate with the toroidal mode number is consistent with the ideal MHD theory. The simulation results verify the GTC capability of simulating MHD processes in toroidal plasmas