Raltegravir is the first FDA-approved drug targeting the strand transfer step of HIV-1 integration. However, the rapid emergence of viral strains that are highly resistant to raltegravir has become a critical problem. Unfortunately, the detailed molecular mechanism of how HIV-1 integrase (IN) mutations actually confer drug resistance is not well understood. In the present study, starting from our previously constructed complex of HIV-1 IN and viral DNA, we employed molecular dynamics (MD) simulation and molecular mechanics generalized Born surface area (MM-GBSA) calculation, to uncover the molecular mechanism behind the resistant mechanism of HIV-1 IN to raltegravir. The values of the calculated binding free energy follow consistently the experimentally observed ranking of resistance levels. A detailed analysis of the results of MD simulation suggests that the Tyr143 located in the 140s loop (e.g., residues from Gly140 to Gly149) is a key anchoring residue that leads to stable raltegravir binding. The decrease in the interaction at this residue is one of the key reasons responsible for the resistance of HIV-1 IN to raltegravir. Additionally, the calculation results also proved that the 3′ adenosine flip in different conformations in the wild-type and mutant HIV-1 IN-viral DNA complexes play an important role in raltegravir binding. Our results could provide a structural and energetic understanding of the raltegravir-resistant mechanism at the atomic level and provide some new clues on how to design new drugs that may circumvent the known resistance mutations.