Compounds are disclosed for treating AIDS, herpes, and other viral infections by means of lipid derivatives of antiviral agents. The compounds consist of nucleoside analogues having antiviral activity which are linked, commonly through a phosphate group at the 5' position of the pentose residue, to one of a selected group of lipids. The lipophilic nature of these compounds provide advantages over the use of the nucleoside analogue alone. It also makes it possible to incorporate them into the lamellar structure of liposomes, either alone or combined with similar molecules. In the form of liposomes, these antiviral agents are preferentially taken up by macrophages and monocytes, cells which have been found to harbor the target HIV virus. Additional site specificity may be incorporated into the liposomes with the addition of ligands, such as monoclonal antibodies or other peptides or proteins which bind to viral proteins. Effective nucleoside analogues are dideoxynucleosides, azidothymine (AZT), and acyclovir; lipid groups may be glycolipids, sphingolipids, phospholipids or fatty acids. The compounds persist, after intracellular hydrolysis, as phosphorylated or non-phosphorylated antiviral nucleosides. The compounds are effective in improving the efficacy of antiviral nucleoside analogues by prolonging the antiviral activity after the administration of the drug has ended, and in preventing retroviral replication in HIV infections which have become resistant to therapy with conventional forms of the antiretroviral agents.