Pathogen populations can evolve in response to selective pressure from vaccine-induced immune responses. For HIV, models predict that viral adaptation, either via strain replacement or selection on de novo mutation, may rapidly reduce the effectiveness of an HIV vaccine. We hypothesized that behavioral risk compensation after vaccination may accelerate the transmission of vaccine resistant strains, increasing the rate of viral adaptation and leading to a more rapid decline in vaccine effectiveness. To test our hypothesis, we modeled: (a) the impact of risk compensation on rates of HIV adaptation via strain replacement in response to a partially effective vaccine; and (b) the combined impact of risk compensation and viral adaptation on vaccine-mediated epidemic control. We used an agent-based epidemic model that was calibrated to HIV-1 trends in South Africa, and includes demographics, sexual network structure and behavior, and within-host disease dynamics. Our model predicts that risk compensation can increase the rate of HIV viral adaptation in response to a vaccine. In combination, risk compensation and viral adaptation can, under certain scenarios, reverse initial declines in prevalence due to vaccination, and result in HIV prevalence at 15 years equal to or greater than prevalence without a vaccine.