The experiment used 45 Comisana ewes, divided into 3 groups of 15. The aim was to determine the effects of two different stocking densities and two different housing conditions on welfare, and on production performance of dairy ewes. The stocking densities tested were: high stocking density (1·5 m2/ewe, HD group) and low stocking density (3 m2/ewe, LD group); the two housing conditions tested were: ewes housed indoors (LD group, 3 m2/ewe) and ewes allowed to use an outdoor area (LDP group, 3 m2/ewe divided into 1·5 m2/ewe indoors and 1·5 m2/ewe outdoors). At the beginning of the experiment, and then every 2 months, the cell-mediated immune status of sheep was evaluated. One month after the beginning of the experiment, and 20 d later, the ewes were injected with chicken egg albumin (OVA) to assess their humoural immune responses. Starting from the beginning of the experiment and then monthly, behavioural activities of ewes were monitored using 15-min scans. After lamb weaning, milk yield from individual ewes was measured and milk composition analysed weekly. Housing conditions (low density reared ewes indoors v. low density reared ewes with free access to an outdoor area) affected cell-mediated response, which was higher in LDP than in LD ewes. Concentrations of anti-OVA IgG were mainly influenced by space allowance, with higher antibody titres in LD than in HD ewes throughout the experiment. Both housing conditions and space allowance affected sheep behavioural activities: a greater proportion of LDP ewes displayed standing and drinking behaviours than LD ewes, and a greater proportion of LD ewes was observed walking than HD ewes. Ewes allowed access to the outdoor area had a higher protein content and lower somatic cell count in their milk, whereas reduced space allowance led to a reduction in milk yield and an increase in somatic cell count of milk. Results indicate that both increased space allowance and availability of outdoor area can improve the welfare and production performance of the lactating ewe.