A new spectrophotometric method has been developed in this paper to determine melamine in milk by applying rank annihilation factor analysis (RAFA) based on pH gradual change-UV spectral data (pH-spectra). In the proposed method, the spectra of the sample solutions at different pH data points were recorded and the pH-spectra bilinear data matrix was generated. Based on these data, the RAFA was then applied to calculate the concentration of melamine in milk. The experiments have been conducted and the results were satisfactory. Under the optimised conditions, linearity of the proposed method was in the range of 0.04-4.0 mu g mL(-1) for calibration samples, and 0.04-3.5 mu g mL(-1) for the mixed solutions of melamine with the background milk components. The detection limit (DL) was 12 ng mL(-1). The relative predictive error (RPEs) and root mean square error of prediction (RMSEP) of applying RAFA were 0.91% and 0.0151, respectively. (C) 2010 Elsevier Ltd. All rights reserved.