HIV-1 can infect both activated and resting, non-dividing cells, following which the viral genome can be permanently integrated into a host cell chromosome. Latent HIV-1 reservoirs are established early during primary infection and constitute a major barrier to eradication, even in the presence of highly active antiretroviral therapy. This Review analyses the molecular mechanisms that are necessary for the establishment of HIV-1 latency and their relationships with different cellular and anatomical reservoirs, and discusses the current treatment strategies for targeting viral persistence in reservoirs, their main limitations and future perspectives.