Foxtail millet has been traditionally considered to possess gastroprotective effects, but studies evaluating its use as a treatment for gastric ulcers are lacking. Here, we assessed the antiulcer effects of foxtail millet protein hydrolysate (FPH) and explored its mechanism by using blocking agents. In a mouse model of ethanol-induced gastric ulcers, pretreatment with FPH reduced the ulcerative lesion index, downregulated the expression of inflammatory cytokines in the gastric tissue, increased the activity of antioxidant enzymes, and improved the oxidative status. FPH increased constitutive the activity of nitric oxide synthase (cNOS), NO levels, and mucin expression in gastric mucosa, and inhibited the activation of the ET-1/PI3K/Akt pathway. In a mouse model of pyloric ligation-induced gastric ulcers, FPH inhibited gastric acid secretion and decreased the activity of gastric protease. Pretreatment of mice with the sulfhydryl blocker NEM and the NO synthesis inhibitor L-NAME abolished the gastroprotective effect of FPH, but not the KATP channel blocker glibenclamide and the PGE2 synthesis blocker indomethacin. Among the peptides identified in FPH, 10 peptides were predicted to have regulatory effects on the gastric mucosa, and the key sequences were GP and PG. The results confirmed the gastroprotective effect of FPH and revealed that its mechanism was through the regulation of gastric mucosal mucus and NO synthesis. This study supports the health effects of a millet-enriched diet and provides a basis for millet protein as a functional food to improve gastric ulcers and its related oxidative stress.