The main aim was to assess the impact of mastitis on technical and economic results of a dairy herd under current Swedish farming conditions. The second aim was to investigate the effects obtained by withdrawing milk with high somatic cell count (SCC). A dynamic and stochastic simulation model, SimHerd, was used to study the effects of mastitis in a herd with 150 cows. Results given the initial incidence of mastitis (32 and 33 clinical and subclinical cases per 100 cow-years, respectively) were studied, together with the consequences of reducing or increasing the incidence of mastitis by 50%, modelling no clinical mastitis (CM) while keeping the incidence of subclinical mastitis (SCM) constant and vice versa. Six different strategies to withdraw milk with high SCC were compared. The decision to withdraw milk was based on herd-level information in three scenarios: withdrawal was initiated when the predicted bulk tank SCC exceeded 220 000, 200 000 or 180 000 cells/ml, and on cow-level information in three scenarios: withdrawal was initiated when the predicted SCC in an individual cow’s milk exceeded 1 000 000, 750 000 or 500 000 cells/ml. The accuracy with which SCC was measured and predicted was assumed to affect the profitability of withdrawing milk with high SCC and this was investigated by applying high, low or no uncertainty to true SCC. The yearly avoidable cost of mastitis was estimated at €8235, assuming that the initial incidence of mastitis could be reduced by 50%. This cost corresponded to 5% of the herd net return given the initial incidence of mastitis. Expressed per cow-year, the avoidable cost of mastitis was €55. The costs per case of CM and SCM were estimated at €278 and €60, respectively. Withdrawing milk with high SCC was never profitable because this generated a substantial amount of milk withdrawal that was not offset by a sufficient increase in the average price per delivered kg milk. It had the most negative impact on net return when high incidence of mastitis was simulated. Withdrawing milk with high SCC based on low-uncertainty information reduced the amount of withdrawn milk and thus resulted in less negative effect on net return. It was concluded that the current milk-pricing system makes it more profitable for farmers to sell a larger amount of milk with higher SCC than to withdraw milk with high SCC to obtain payment premiums, at least in herds with mastitis incidences within the simulated ranges.