We have shown that an antimicrobial peptide (AMP) cecropinXJ isolated from the larvae of Bombyx mori selectively inhibits the proliferation of cancer cells. However, the mechanism remains to be determined. In the present study, we examined the antitumor activity of cecropinXJ against human gastric cancer BGC823 cells and explored the mechanism. The results showed that cecropinXJ inhibited the growth of gastric cancer BGC823 cells in vitro and in vivo. MTT and colony formation assays indicated that cecropinXJ suppressed cell proliferation and reduced colony formation of BGC823 cells in a dose- and time-dependent manner, but without inhibitory effect on normal gastric epithelia GES-1 cells. S-phase arrest in BGC823 cells was observed after treatment with cecropinXJ. Annexin V/PI staining suggested that cecropinXJ induced both early and late phases of apoptosis through activation of mitochondrial-mediated caspase pathway, upregulation of Bax expression and downregulation of Bcl-2 expression. Additionally, cecropinXJ treatment increased reactive oxygen species (ROS) production, disrupted the mitochondrial membrane potential (Δψm) and led to release of cytochrome c. Importantly, in vivo study showed that cecropinXJ significantly prevented the growth of xenograft tumor in the BGC823-bearing mice, possibly mediated by the induction of apoptosis and inhibition of angiogenesis. These results suggest that cecropinXJ may be a promising therapeutic candidate for the treatment of gastric cancer.