We performed a magnetohydrodynamic (MHD) simulation using a nonlinear force-free field (NLFFF) in solar active region 11158 to clarify the dynamics of an X2.2-class solar flare. We found that the NLFFF never shows the drastic dynamics seen in observations, i.e., it is in stable state against the perturbations. On the other hand, the MHD simulation shows that when the strongly twisted lines are formed at close to the neutral line, which are produced via tether-cutting reconnection in the twisted lines of the NLFFF, consequently they erupt away from the solar surface via the complicated reconnection. This result supports the argument that the strongly twisted lines formed in NLFFF via tether-cutting reconnection are responsible for breaking the force balance condition of the magnetic fields in the lower solar corona. In addition to this the dynamical evolution of these field lines reveals that at the initial stage the spatial pattern of the footpoints caused by the reconnection of the twisted lines appropriately maps the distribution of the observed two-ribbon flares. Interestingly, after the flare the reconnected field lines convert into the structure like the post flare loops, which is analogous to EUV image taken by SDO. Eventually, we found that the twisted lines exceed a critical height at which the flux tube becomes unstable to the torus instability. These results illustrate the reliability of our simulation and also provide an important relationship between flare-CME dynamics.