Background: The Herpes simplex virus type 2, currently classified as Human alphaherpesvirus 2 (HSV-2) is the main cause of genital herpes, one of the most prevalent sexually transmitted infections (STIs) in the world. STIs are one of the major public health problems in prisons due to the behaviors of prisoners and the factors that increase the risk of transmission. The present study aimed to estimate the prevalence and risk factors associated with HSV-2 infection at 12 prisons in Mato Grosso of Sul, Brazil. Results: We tested 872 serum samples (732 males and 140 females) for anti-HSV-2 IgG and anti-HSV-2 IgM. The overall HSV-2 IgG prevalence was 43.1%, and the prevalence was greater in males than females (32.1% vs. 11%). The prevalence of HSV-2 in females were 3.4 times more than in males in adjusted model. Among the 184 samples HSV-2 IgG tested for IgM anti HSV-2, 46% were positive. The prevalence of HSV-2 positivity was much greater than reported in the general population of Brazil and in other prison populations worldwide. The multivariable model adjusted, indicated significant and independent associations of HSV-2 IgG positivity with female sex, age older than 29 to 39 years, unmarried status, history of STI, no previous incarceration, being incarcerated with more than 26 others, presence of genital discharge, previous homosexual intercourse, HIV-positivity, and no use/occasional use of condoms during sexual intercourse. Conclusions: This is the first study that evaluated HSV-2 in a prison population in Brazil. These data provide important information needed to implement procedures that better prevent and control of STIs in prison populations.