A duplex polymerase chain reaction (PCR) assay for DNA from herpes simplex virus types 1 (HSV-1) and 2 (HSV-2) was applied to cerebrospinal fluid (CSF) from 918 human immunodeficiency virus (HIV)-infected patients with neurological symptoms. HSV-1 or HSV-2 (HSV-1/2) DNA was found in 19 patients (2%). For the 258 patients for whom a diagnosis was confirmed at autopsy, the sensitivity and specificity of PCR analysis for the diagnosis of HSV-1/2 encephalitis were 100% and 99.6%, respectively. Three patients with CD4+ cell counts of > or = 170/microL had HSV-1 central nervous system (CNS) infections (two) or HSV-2 meningitis (one). Sixteen patients with CD4+ cell counts of < 40/microL had HSV-1 CNS infections (two) or mixed HSV-1/2 and cytomegalovirus encephalitis (14). The response to antiviral treatment, which was assessed clinically and by CSF PCR analysis, was variable in the patients with the highest CD4+ cell counts and poor in those with more severe immunosuppression. CSF PCR analysis is of value for the diagnosis and follow-up of treatment of HSV-1/2 CNS infections in HIV-infected patients.