Integration of viral DNA into cellular DNA is an essential step in the replication cycle of HIV and other retroviruses. The first antiviral drugs that target integrase, the viral enzyme that catalyzes DNA integration, have recently been approved and more are in the pipeline. These drugs bind to an intermediate in DNA integration called the intasome, in which a pair of viral DNA ends are synapsed by a tetramer of integrase, rather than free integrase enzyme. We discuss the biochemical mechanism of integration, which is now quite well understood, and recent progress towards obtaining atomic-resolution structures of HIV intasomes in complex with inhibitors. Such structures are ultimately required to understand the detailed mechanism of inhibition and the mechanisms by which mutations in integrase confer resistance. The path from early biochemical studies to therapeutic inhibitors of integrase highlights the value of basic science in fighting human diseases.