Effects of social isolation or restraint, applied outside the home pen, on adrenocortical and nociceptive responses were examined in 28 loose-housed dairy cows. Treatments lasted 15 min and consisted of social isolation in novel surroundings or restraint by the head in a test pen. A control treatment was applied in the test pen as well. Each cow was exposed to all treatments in a balanced order, with 3 to 4 d between treatments. Compared with the control treatment, social isolation in novel surroundings led to increased plasma concentration of cortisol (P < 0.001) as well as to indications of hypoalgesia [posttreatment lack of decrease in latency to respond toward nociceptive laser stimulation, a tendency for decreased frequency of kicking in the pauses between laser stimulations (P = 0.06), and an increased proportion of leg moving (least possible active response) after treatment (P = 0.04)]. Indications of hypoalgesia were also observed after restraint (reduced kicking in response to laser stimulation, P = 0.04); however, the indications were to a lesser extent than after social isolation, and restraint treatment did not lead to increased plasma concentration of cortisol. For control and restraint treatment, an initial increase (P < 0.02) in plasma concentration of cortisol was found, suggesting effects of pretreatment factors such as handling. No correlations between adrenocortical and nociceptive responses toward social isolation were found. The results confirm earlier reports stating that nociceptive changes induced by environmental challenges can be shown in dairy cows, even when they are kept in groups and removed from the home pen during the study of stress responses. However, testing outside the home pen seemed to affect the nociceptive and adrenocortical responses, thereby suggesting that care should be taken to avoid effects of pretreatment situational factors.