Melatonin (N-acetyl-5-methoxytryptamine) is an indoleamine that is synthesized from the essential amino acid L-tryptophan. It has a number of important activities that include neurohormone and chronobiotic actions in biological systems. There is good evidences that melatonin provides effective treatments for cardiovascular diseases, sleep disorders and headache. Melatonin is a naturally occurring compound that is found in humans, animals, plants and microbes. The presence of melatonin in plants has been identified in a range of species including rice (Oryza sativa). Hence, a suitable extraction method is needed to determine melatonin levels in both rice and rice derived foods. In this research, a new ultrasound-assisted extraction (UAE) of melatonin has been optimized and validated. Box-Behnken design in conjunction with response surface methodology was used based on six factors and three levels to evaluate the significances of studied factors prior to optimize the UAE condition. The effects of solvent composition (0−50% methanol in water), extraction temperature (10−70oC), solvent-solid ratio (2.5:1−5:1), solvent pH (3−7), amplitude (30−70 %) and cycle (0.2−0.7 s-1) on the extraction yields were taken into account. Subsequently, extraction kinetic (5−30 min) was studied to confirm high recovery of melatonin extracted from the matrix. The levels of melatonin in the UAE extracts were quantified by Ultrahigh Performance Liquid Chromatography using a fluoresce detection (UPLC-FD) in less than 4 min. The significant (p<0.05) response surface models with high coefficients of determination values of 0.7245 were fitted for the experimental data. Solvent composition and extraction temperature were found to have a greatly significant effect on the response value (p<0.005). The optimal UAE condition was as follows: extraction time 10 min, ultrasound amplitude 30%, cycle 0.2 s-1, extraction temperature 40oC, 50:50 methanol:water as the extraction solvent at pH 3.5 and solvent-solid ratio 2.5:1. Complete validation of the method was performed. The developed method presented recoveries between 90% and 109% for the target analytes and showed high precision in terms of CV lower than 2.0% for intermediate precision. The suitability of the method was checked by application to semi-finished and finished rice products thus could assess the melatonin profile throughout the rice production. Melatonin was determined in two different rice varieties taken at different production processes i.e. drying (dried paddy), hulling (whole grain rice), and polishing (polished rice). Additionally, the effect of cultivation system on the melatonin content in rice was also able to be evaluated by applying the developed method to different rice varieties produced by conventional and organic farming of black and red rice. Hence, this particular ultrasound extraction method was demonstrated to be an excellent alternative for the extraction of melatonin from rice grain samples.