All the quarters in the cows with high somatic cell counts in 10 herds were treated at drying off with either 600 mg cloxacillin or 600 mg cloxacillin and 4 g of an internal teat sealant containing 65 per cent bismuth subnitrate. The quarters were sampled daily for bacteriological tests for the three days before drying off and twice after calving to establish whether they were infected. Clinical mastitis cases were monitored from drying off until 100 days after calving. The odds of a quarter being bacteriologically negative after calving or developing clinical mastitis in the first 100 days after calving were investigated by multilevel logistic regression. The quarters treated with the internal sealant and cloxacillin were significantly more likely to be bacteriologically negative in the immediate period after calving and were significantly less likely to suffer clinical mastitis during the first 100 days after calving than the quarters treated with cloxacillin alone. There was more variation between cows than between herds in the underlying risk of an infection after calving, but there was more variation between herds than between cows in the underlying risk of clinical mastitis during the 100 days after calving.