A total of 1304 goat udder halves were sampled monthly during an entire lactation (6262 samples) with the aim of identifying factors affecting milk somatic cell count (SCC). Bacteriological analyses for identification of mastitis pathogens were carried out on all samples and SCC was also determined. All animals were examined for infection by caprine arthritis-encephalitis virus (CAEV) using a commercial ELISA test kit. Results obtained were arranged in two databases (whole-lactation average half-udder database and monthly half-udder database) and two mixed models were applied. Random effects of half udder nested into flock and fixed effects of flock, intramammary infection (IMI) status, number of kids born, length of lactation and interaction of parity with IMI status were significant for the first database. CAEV infection and its interaction with IMI status was not significant. Milk SCC was significantly increased for infected udder halves and milk from udder halves infected with minor pathogens had lower SCC than udder halves infected with major pathogens. For healthy udder halves, SCC was higher in older animals but this effect was not evident in halves with IMI. Multiple birth and short-duration lactation were factors associated with elevated milk SCC. The second mixed model considered repeated measures in time for consecutive samplings throughout lactation (stage of lactation) which was also a significant factor with increasing stage of lactation. The influence of all these factors should be taken into account in the establishment of more reliable diagnostic SCC thresholds for IMI.