In Denmark, the concentration of pig production is highest in the western part of the country. However, there may be even larger local differences in the number of pigs produced. In this study we analyze the determinants of the location of pig production in Denmark with particular focus on spatial externalities and the interaction between the location of pig production and upstream sector and slaughterhouses. It is the assumption that the location of slaughterhouses is influenced by the location of the primary producers, implying that this variable is endogenous, whereas the location of primary producers is independent of the location of slaughterhouses. This is due to the fact that transportation costs of pigs are paid by the cooperatives owning the slaughterhouses. This assumption is tested applying a spatial econometric model. The model is estimated for 1999 and 2004. Furthermore, the impact of negative environmental externalities of pig production on location is analyzed. The results show that spatial externalities have a positive effect on the location of pig production whereas environmental regulation has a negative effect on location.