This study assessed the prevalence and risk factors associated with gastrointestinal parasite infection in goats in Ayacucho, Peru. Fecal samples were collected from a total of 254 goats from four districts of Ayacucho: Ocaña (89), Colca (76), Pacaicasa (64), and Luricocha (25) during the dry season; recording the location, sex, and age of the animals. The fecal samples were analyzed using the flotation technique in salt and sugar solution, and modified McMaster egg counting techniques for eggs/oocysts (epg/opg) of gastrointestinal parasites. The associations between location, sex, and age with the prevalence of gastrointestinal parasites were analyzed using the chi-square test. Fecal samples showed an overall parasite prevalence of 87.80%. The identified parasites were Eimeria spp. (86.22%), Strongyle type eggs (STE) (65.75%), Skrjabinema spp. (7.87%), Trichuris spp. (3.15%) and Moniezia spp. (3.15%). There was a significant association between the location and the presence of parasites (p < 0.05); where STE was more prevalent in the district of Colca (98.68%); Trichuris spp. in Pacaycasa (9.38%); Skrjabinema spp. (48.00%), Moniezia spp. (12.00%) and Eimeria spp. (100%) were more prevalent in Luricocha. Sex had a significant association with the prevalence of Eimeria spp., Skrjabinema spp. and Moniezia spp. (p < 0.05); while age had a significant association with parasitosis only for Trichuris spp. and Moniezia spp. (p < 0.05). The epg/opg values revealed a higher parasite burden in goats from Colca compared to the other locations (p < 0.05). There was also no statistical relationship between fecal egg/oocyst counts and sex or age, nevertheless, there were moderate and high parasitic burdens. The high prevalence of parasites such as nematodes, cestodes, and coccidia suggests the need to implement strategic control and prevention programs in free-grazing goats. Location and sex were the most relevant risk factors for parasitosis in Ayacucho, Peru.