Acyclovir injection is used to treat herpes simplex encephalitis (brain infection with swelling caused by the herpes virus) and herpes infections in newborn infants.Acyclovir injection is in a class of antiviral medications called synthetic nucleoside analogues.