Social factors are important determinants of disease in humans and and laboratory animals, but less research has been done using farm animals. The objective of this study was to determine if an unpredictable and competitive social environment affects behavior and health during the transition period when dairy cows are at high risk of disease. Five weeks before calving, 64 cows were assigned to a predictable and noncompetitive social environment (predictable) or an unpredictable and competitive social environment (unpredictable) using 8 groups of 4 animals per treatment. Each group consisted of 3 multiparous and 1 primiparous cow. At first enrollment (baseline; 5 wk before calving), all groups had access to 4 electronic feed bins. At 4 wk before calving, cows in the predictable groups were given access to 6 feed bins, and cows in the unpredictable groups were moved into a new pen with 4 resident cows each trained to consume feed from one bin. Each cow in the unpredictable group was then provided access to only 1 of the 4 feed bins which they shared with 1 resident cow (resulting in 2 cows/bin), creating a competitive feeding environment. To create an unpredictable environment, access to morning feed was delayed 0, 1, 2, or 3 h every other day. On alternate days, the cows in unpredictable groups were assigned to feed from a new feed bin (and thus had to compete with a new resident partner). Feeding and social behavior were collected electronically from the feed bins. Blood was sampled at baseline (wk -5), wk -2, wk -1, and wk +1 relative to calving to measure inflammatory (haptoglobin and tumor necrosis factor-α) and metabolic (nonesterified fatty acids, β-hydroxybutyrate, calcium, and glucose) biomarkers. Uterine cytology was performed 3 to 5 wk after calving to diagnose cytological endometritis. Data were analyzed using mixed models including baseline data as a covariate, week as a repeated measure, treatment as a main effect, and a treatment by week interaction. The probability of cytological endometritis at the group level was analyzed using Mann-Whitney U tests. Parity was included in separate models to determine any parity × treatment interactions. Cows from both treatments consumed the same amount of feed, but cows in the unpredictable group spent less time feeding and had a higher rate of feed intake. Cows in the unpredictable groups also visited the feed bins less often, consumed more feed during each visit, and were involved in more social replacements at the feed bin compared with predictable groups. Cows in the unpredictable groups had higher serum concentrations of nonesterified fatty acids and tumor necrosis factor-α, but lower β-hydroxybutyrate compared with predictable groups. Multiparous cows in unpredictable groups were more likely to be diagnosed with cytological endometritis after calving compared with cows in the predictable groups, but primiparous cows in unpredictable groups showed a tendency for the opposite response. These results suggest that an unpredictable and competitive social environment before calving causes changes in feeding and social behavior, some physiological indicators of metabolism and inflammation, and increases the risk of uterine disease in multiparous cows after calving.