Over a 20-year period we have observed the dynamics of HIV-1 subtypes and HIV-2 infection in a prospective cohort of registered female sex workers (FSW) in Dakar, Senegal. Prevalence and incidence rates for HIV-1 and HIV-2 are described from 290 seroprevalent and 193 seroincident subjects who were among the 3,910 women enrolled between 1985 and 2004. We report a significant decrease of HIV-2 prevalence in the cohort, parallel to the introduction and rise of HIV-1 infection. In 328 HIV-1-infected women, a 385-bp C2-V3 fragment of the envelope gene was sequenced and classified into the following subtypes or recombinant forms: 239 (72%) were subtype A [of which 180 (55%) were CRF02_AG and 53 (16%) were A3], 10 (3%) were B, 12 (4%) were C, 11 (4%) were D, 18 (6%) were G, 24 (7%) were CRF06_cpx, and 7 (2%) were CRF09_cpx. We found an increasing proportion of CRF02_AG over many years, but recently subsubtype A3 has over-taken CRF02_AG, with the largest proportion of new infections. The predominance of existing HIV-1 subtypes did not preclude the emergence and increase of other closely related subtypes or recombinant forms. This 20-year prospective serological and sequence analysis of HIV viruses reveals a complex and changing HIV epidemic in Senegal.