The objective of this work was to estimate covariance functions for additive genetic and permanent environmental effects, as well as to obtain genetic parameters for buffalo test-day milk yield using random regression models on Legendre polynomials (LPs). A total of 2,538 test-day milk yield (TDMY) records from 516 first lactation records of Khuzestan buffalo, calving from 1993 to 2009 and belonging to 150 herds located in the state of Khuzestan, Iran, were analyzed. The residual variances were modeled through a step function with 1, 5, 6, 9, and 19 classes. The additive genetic and permanent environmental random effects were modeled by LPs of days in milk using quadratic to septic polynomial functions. The model with additive genetic and animal permanent environmental effects adjusted by cubic and third order LP, respectively, and with the residual variance modeled through a step function with nine classes was the most adequate one to describe the covariance structure. The model with the highest significant log-likelihood ratio test (LRT) and with the lowest Akaike information criterion (AIC) and Bayesian information criterion (BIC) was considered to be the most appropriate one. Unexpected negative genetic correlation estimates were obtained between TDMY records of the twenty-fifth and thirty-seventh week (-0.03). Genetic correlation estimates were generally higher, close to unity, between adjacent weeks during the middle of lactation. Random regression models can be used for routine genetic evaluation of milk yield in Khuzestan buffalo.