Global warming has multifarious adverse effects on plant growth and productivity. Nonetheless, the effects of endogenous phytomelatonin on the high‐temperature resistance of plants and the underlying genetic mechanisms remain unclear. Here, herbaceous peony (Paeonia lactiflora Pall.) tryptophan decarboxylase (TDC) gene involved in phytomelatonin biosynthesis was shown to respond to high‐temperature stress at the transcriptional level, and its transcript level was positively correlated with phytomelatonin production. Moreover, overexpression of PlTDC enhanced phytomelatonin production and high‐temperature stress tolerance in transgenic tobacco, while silencing PlTDC expression decreased these parameters in P. lactiflora. In addition, a 2402 bp promoter fragment of PlTDC was isolated, and DNA pull‐down assay revealed that one APETALA2/ethylene‐responsive element‐binding factor (AP2/ERF) transcription factor, PlTOE3, could specifically activate the PlTDC promoter, which was further verified by yeast one‐hybrid assay and luciferase reporter assay. PlTOE3 was a nucleus‐localized protein, and its transcript level responded to high‐temperature stress. Additionally, transgenic tobacco overexpressing PlTOE3 showed enhanced phytomelatonin production and high‐temperature stress tolerance, while silencing PlTDC expression obtained the opposite results. These results illustrated that PlTOE3 bound the PlTDC promoter to enhance high‐temperature stress tolerance by increasing phytomelatonin production in P. lactiflora.