Objective: Psychological factors are known to be associated with functional gastrointestinal disorders (FGIDs) including irritable bowel syndrome (IBS) and functional dyspepsia (FD). No prospective studies have evaluated whether it is the brain (eg, via anxiety) that drives gut symptoms, or whether gut dysfunction precipitates the central nervous system features such as anxiety. In a 12-year longitudinal, prospective, population-based study, we aimed to determine the directionality of the brain-gut mechanism in FGIDs. Design: Participants (n=1775) were a random population sample from Australia who responded to a survey on FGIDs in 1997 and agreed to be contacted for future research; 1002 completed the 12-year follow-up survey (response rate =60%), with 217, 82 and 45 people meeting Rome II for new onset FGIDs, IBS and FD, respectively. Anxiety and depression were measured using the Delusions Symptom States Inventory at baseline and follow-up. Results: Among people free of a FGID at baseline, higher levels of anxiety (OR 1.11; 95% CI 1.03 to 1.19, p=0.006) but not depression at baseline was a significant independent predictor of developing new onset FGIDs 12 years later. Among people who did not have elevated levels of anxiety and depression at baseline, those with a FGID at baseline had significantly higher levels of anxiety and depression at follow-up (mean difference coefficient 0.76, p<0.001 and 0.30, p=0.01 for anxiety and depression, respectively). In IBS higher levels of anxiety and depression at baseline were predictive of IBS at follow-up, while only depression was predictive of FD at follow-up. Conclusions: The central nervous system and gut interact bidirectionally in FGIDs.