Fibromyalgia (FM) is a prevalent syndrome, characterised by chronic widespread pain, fatigue, and impaired sleep, that is challenging to diagnose and difficult to treat. The microbiomes of 77 women with FM and that of 79 control participants were compared using 16S rRNA gene amplification and whole-genome sequencing. When comparing FM patients with unrelated controls using differential abundance analysis, significant differences were revealed in several bacterial taxa. Variance in the composition of the microbiomes was explained by FM-related variables more than by any other innate or environmental variable and correlated with clinical indices of FM. In line with observed alteration in butyrate-metabolising species, targeted serum metabolite analysis verified differences in the serum levels of butyrate and propionate in FM patients. Using machine-learning algorithms, the microbiome composition alone allowed for the classification of patients and controls (receiver operating characteristic area under the curve 87.8%). To the best of our knowledge, this is the first demonstration of gut microbiome alteration in nonvisceral pain. This observation paves the way for further studies, elucidating the pathophysiology of FM, developing diagnostic aids and possibly allowing for new treatment modalities to be explored.