The objective of this study was to compare the effect of the temperature-humidity index (THI) on milk production traits and somatic cell score (SCS) of dairy cows raised in 4 different housing systems: (1) warm loose housing with access to grazing (WG), (2) warm loose housing without access to grazing (WI), (3) cold loose housing with access to grazing (CG), and (4) cold loose housing without access to grazing (CI). For each of the 4 housing systems, 5 farms with a herd size of 70 to 200 lactating cows in Lower Saxony, Germany, were studied. Ambient temperature and relative humidity were recorded hourly in each barn to calculate THI. Milk production data included 21,546 test-day records for milk, fat, and protein yield, and SCS. These data were associated with the average THI of the 3 d preceding the respective measurement, which was divided into 6 classes (45, ≥45 to50, ≥50 to55, ≥55 to60, ≥60 to65, and ≥65). Furthermore, bulk milk samples including the fat and protein percentage, and SCS taken 4 to 6 times per month were associated with the average and maximum THI of the 3 d before sampling. Data were recorded from April 2010 to March 2011. In each of the housing systems, monthly THI values above 60, indicating heat stress, were recorded between June and September, with higher values in WI and WG. In all systems, fat-corrected milk, fat, and protein yields of the test-day records decreased in tendency from 60 ≤ THI65 to THI65. In WI and CI, values for SCS were greater in the class THI65 than in 60 ≤ THI65, whereas no difference between any of the THI classes was found in WG and CG. The fat and protein percentage of the bulk milk samples decreased with increasing 3-d maximum THI in all 4 systems, whereas the SCS increased with increasing 3-d average THI. In conclusion, negative effects of heat stress conditions under a temperate climate on milk production traits and SCS were found, although a housing system being superior to the other systems in altering heat stress effects was not identified.