Gastrointestinal (GI) discomfort is a hallmark of most gut disorders and represents an important component of chronic visceral pain. For the growing population afflicted by irritable bowel syndrome, GI hypersensitivity and pain persist long after tissue injury has resolved. Irritable bowel syndrome also exhibits a strong sex bias, afflicting women three times more than men. Here, we focus on enterochromaffin (EC) cells, which are rare excitable, serotonergic neuroendocrine cells in the gut epithelium. EC cells detect and transduce noxious stimuli to nearby mucosal nerve endings but involvement of this signalling pathway in visceral pain and attendant sex differences has not been assessed. By enhancing or suppressing EC cell function in vivo, we show that these cells are sufficient to elicit hypersensitivity to gut distension and necessary for the sensitizing actions of isovalerate, a bacterial short-chain fatty acid associated with GI inflammation. Remarkably, prolonged EC cell activation produced persistent visceral hypersensitivity, even in the absence of an instigating inflammatory episode. Furthermore, perturbing EC cell activity promoted anxiety-like behaviours which normalized after blockade of serotonergic signalling. Sex differences were noted across a range of paradigms, indicating that the EC cell-mucosal afferent circuit is tonically engaged in females. Our findings validate a critical role for EC cell-mucosal afferent signalling in acute and persistent GI pain, in addition to highlighting genetic models for studying visceral hypersensitivity and the sex bias of gut pain.