The objective of this study was to evaluate the ability of milk infrared spectra to predict blood β-hydroxybutyrate (BHB) concentration for use as a management tool for cow metabolic health on pasture-grazed dairy farms and for large-scale phenotyping for genetic evaluation purposes. The study involved 542 cows (Holstein-Friesian and Holstein-Friesian × Jersey crossbreds), from 2 farms located in the Waikato and Taranaki regions of New Zealand that operated under a seasonal-calving, pasture-based dairy system. Milk infrared spectra were collected once a week during the first 5 wk of lactation. A blood "prick" sample was taken from the ventral labial vein of each cow 3 times a week for the first 5 wk of lactation. The content of BHB in blood was measured immediately using a handheld device. After outlier elimination, 1,910 spectra records and corresponding BHB measures were used for prediction model development. Partial least square regression and partial least squares discriminant analysis were used to develop prediction models for quantitative determination of blood BHB content and for identifying cows with hyperketonemia (HYK). Both quantitative and discriminant predictions were developed using the phenotypes and infrared spectra from two-thirds of the cows (randomly assigned to the calibration set) and tested using the remaining one-third (validation set). A moderate accuracy was obtained for prediction of blood BHB. The coefficient of determination (R2) of the prediction model in calibration was 0.56, with a root mean squared error of prediction of 0.28 mmol/L and a ratio of performance to deviation, calculated as the ratio of the standard deviation of the partial least squares model calibration set to the standard error of prediction, of 1.50. In the validation set, the R2 was 0.50, with root mean squared error of prediction values of 0.32 mmol/L, which resulted in a ratio of performance to deviation of 1.39. When the reference test for HYK was defined as blood concentration of BHB ≥1.2 mmol/L, discriminant models indicated that milk infrared spectra correctly classified 76% of the HYK-positive cows and 82% of the HYK-negative cows. The quantitative models were not able to provide accurate estimates, but they could differentiate between high and low BHB concentrations. Furthermore, the discriminant models allowed the classification of cows with reasonable accuracy. This study indicates that the prediction of blood BHB content or occurrence of HYK from milk spectra is possible with moderate accuracy in pasture-grazed cows and could be used during routine milk testing. Applicability of infrared spectroscopy is not likely suited for obtaining accurate BHB measurements at an individual cow level, but discriminant models might be used in the future as herd-level management tools for classification of cows that are at risk of HYK, whereas quantitative models might provide large-scale phenotypes to be used as an indicator trait for breeding cows with improved metabolic health.