[Note: As of 2/28/2001, due to toxicity studies and concern for safety, changes in the methodology were implemented and patients need to sign new informed consents. The study is unblinded. Group 1 receives AG1549; Group 2 receives an AG1549 placebo. Patients who are taking capravirine and who currently have viral loads below 400 copies/ml may continue to take capravirine at 1400 mg twice daily. Capravirine will be discontinued in patients with viral loads greater than 400 copies/ml at their last visit and they will be switched to new therapies or continue with their background therapies as deemed appropriate by the investigators.] Both groups also receive nelfinavir mesylate and 2 NRTIs. All patients receive the same dose of nelfinavir mesylate. The NRTIs are selected at the investigator's discretion provided the patient has not previously received the chosen NRTIs. Patients have regular physical examinations. Blood samples are collected regularly and at 1 month post-treatment to determine plasma HIV RNA, pharmacokinetics, and CD4 and CD8 counts. Patients who complete 24 weeks of treatment will have the option to continue treatment for an additional 24 weeks or end participation.