Crushing of piglets can be a major problem in loose-housing farrowing systems. In this study, we investigated the influence of straw of different lengths provided as nest-building material, sow behaviour and room temperature on the incidence of dangerous situations for the piglets. Piglets were defined as in danger of being crushed if they were trapped by the sow's body or if they jumped aside in response to the lying down or rolling behaviour of the sow.The behaviour of 22 Large White sows and their piglets was video-recorded from 10 h before farrowing until 72 h afterwards. The sows were kept in loose farrowing pens equipped with a creep area and a heating lamp. For a period of 5 days (48 h before the expected farrowing until 72 h after farrowing) 11 sows each had access to either 2 kg of long-stemmed straw or 2 kg of short-cut straw provided on the floor.Sows in pens with short-cut straw manipulated the pen equipment more frequently during the 10 h before farrowing than sows in pens with long-stemmed straw (P = 0.02). The number of dangerous situations was associated positively with the time the sow spent nest-building during farrowing (P < 0.01) and with the occurrence of events in which she laid down laterally without leaning against a wall and with more than two piglets present during the first 3 days after farrowing (P = 0.04). The incidence of dangerous situations also decreased over the first days after farrowing (P < 0.001), increased with the time the sow spent moving around before lying down (P = 0.04), and was inversely related to the duration of the lying-down movement (P = 0.05). Moreover, the more piglets there were present during a lying-down movement the higher was the incidence (P = 0.02), especially if they were not grouped on only one side of the sow's body (P = 0.03). Room temperature was associated positively with the time it took the piglets to get to the creep area after birth (P = 0.01) and negatively with the time they spent there (P = 0.02) but did not affect the incidence of dangerous situations. Straw length had no significant influence on the total pre-weaning piglet mortality or the proportion of piglets crushed.In conclusion, we found that sow behaviour was hardly affected by straw length but had a major influence on the occurrence of situations with a risk of crushing piglets.