On the basis of a series of lactam and phthalimide derivatives that inhibit HIV-1 integrase, we developed a new molecule, XZ-259, with biochemical and antiviral activities comparable to raltegravir. We determined the crystal structures of XZ-259 and four other derivatives in complex with the prototype foamy virus intasome. The compounds bind at the integrase-Mg(2+)-DNA interface of the integrase active site. In biochemical and antiviral assays, XZ-259 inhibits raltegravir-resistant HIV-1 integrases harboring the Y143R mutation. Molecular modeling is also presented suggesting that XZ-259 can bind in the HIV-1 intasome with its dimethyl sulfonamide group adopting two opposite orientations. Molecular dynamics analyses of the HIV-1 intasome highlight the importance of the viral DNA in drug potency.