Treating HIV-infected patients with a combination of several antiretroviral drugs usually contributes to a substantial decline in viral load and an increase in CD4(+) T cells. However, continuing viral replication in the presence of drug therapy can lead to the emergence of drug-resistant virus variants, which subsequently results in incomplete viral suppression and a greater risk of disease progression. In this paper, we use a simple mathematical model to study the mechanism of the emergence of drug resistance during therapy. The model includes two viral strains: wild-type and drug-resistant. The wild-type strain can mutate and become drug-resistant during the process of reverse transcription. The reproductive ratio [Symbol: see text](0) for each strain is obtained and stability results of the steady states are given. We show that drug-resistant virus is more likely to arise when, in the presence of antiretroviral treatment, the reproductive ratios of both strains are close. The wild-type virus can be suppressed even when the reproductive ratio of this strain is greater than 1. A pharmacokinetic model including blood and cell compartments is employed to estimate the drug efficacies of both the wild-type and the drug-resistant strains. We investigate how time-varying drug efficacy (due to the drug dosing schedule and suboptimal adherence) affects the antiviral response, particularly the emergence of drug resistance. Simulation results suggest that perfect adherence to regimen protocol will well suppress the viral load of the wild-type strain while drug-resistant variants develop slowly. However, intermediate levels of adherence may result in the dominance of the drug-resistant virus several months after the initiation of therapy. When more doses of drugs are missed, the failure of suppression of the wild-type virus will be observed, accompanied by a relatively slow increase in the drug-resistant viral load.