A database consisting of 35291 milking records from 83 cows was built over a period of 10 months with the objectives of studying the effect of teat cup attachment failures and milking interval regularity on milk production with an automated milking system (AMS). The database collected records of lactation number, days in milk (DIM), milk production, interval between milkings (for both the entire udder and individual quarters in case of a teat cup attachment failure) and average and peak milk flows for each milking. The weekly coefficient of variation (CV) of milking intervals was used as a measure of milking regularity. DIM, milking intervals, and CV of milking intervals were divided into four categories coinciding with the four quartiles of their respective distributions. The data were analysed by analysis of variance with cow as a random effect and lactation number, DIM, the occurrence of a milking failure, and the intervals between milkings or the weekly CV of milking intervals as fixed effects. The incidence of attachment failures was 7·6% of total milkings. Milk production by quarters affected by a milking failure following the failure was numerically greater owing to the longer interval between milkings. When accounting for the effect of milking intervals, milk production by affected quarters following a milking failure was 26% lower than with regular milkings. However, the decrease in milk production by quarters affected by milking failures was more severe as DIM increased. Average and peak milk flows by quarters affected by a milking failure were lower than when milkings occurred normally. However, milk production recovered its former level within seven milkings following a milking failure. Uneven frequency (weekly CV of milking intervals >27%) decreased daily milk yield, and affected multiparous more negatively than primiparous cows.