Melatonin (MT) is a multi–regulatory molecule eliciting pleiotropic effects on plant growth and development. Glucosinolates (GS) are a group of sulfur (S)-rich and nitrogen (N)-containing secondary metabolites that play an important role in plant defense. Although MT treatment is known to strongly induce expression of GS metabolism related genes, it still remains unclear how MT modulates GS profile. In order to better understand the molecular mechanisms of MT-regulated GS profile in Brassica rapa, comparative transcriptomics and HPLC analyses were conducted. Upon MT treatment, overall GS accumulation increased 3.2-fold, along with emergence of three new GS of glucocochlearin (GCR), glucoerucin (GEC) and 4-hydroxyglucobrassicin (4-OHGBC), and aliphatic GS was the most abundant form constituting 63% of the total GS content. Besides, MT treatment generated eleven differentially expressed genes involved in GS biosynthesis, among which eight encode GS pathway enzymes, and three encode MYB transcription factors modulating expression of GS biosynthesis genes. This was accompanied by significantly elevated expression of three S assimilation-related genes and glutamine synthetase gene involved in N assimilation. In vitro disk-diffusion bioassay demonstrated that lyophilized powder of MT-treated rosette leaf, as well as hydrolyzed products of GCR and GEC significantly inhibited the growth of Sclerotinia sclerotiorum. There was a statistically significant negative correlation between 4-OHGBC and colony growth rate, and between 4-methoxyglucobrassicin (4MeGBC) and sclerotia number. Taken together, the results suggested that exogenous MT treatment altered GS profiles and contents by activating the expression of the primary metabolism genes for S and N assimilation, as well as the secondary metabolism genes for GS biosynthesis, thereby playing a prominent role in S. sclerotiorum resistance in B. rapa. MT as an amphiphilic bio-substance, which can easily pass though the cell membrane, may offer a new integrated strategy for ecofriendly and sustainable management to control plant diseases.