The knowledge on how gut microbes contribute to the inflammatory bowel disease (IBD) at the onset of disease is still scarce. We compared gut microbiota in newly diagnosed, treatment-naïve adult IBD (Crohn’s disease (CD) and ulcerative colitis (UC)) to irritable bowel syndrome (IBS) patients and healthy group. Mucosal and fecal microbiota of 49 patients (13 UC, 10 CD, and 26 IBS) before treatment initiation, and fecal microbiota of 12 healthy subjects was characterized by 16S rRNA gene sequencing. Mucosa was sampled at six positions, from terminal ileum to rectum. We demonstrate that mucosal microbiota is spatially homogeneous, cannot be differentiated based on the local inflammation status and yet provides bacterial footprints superior to fecal in discriminating disease phenotypes. IBD groups showed decreased bacterial diversity in mucosa at all taxonomic levels compared to IBS. In CD and UC, Dialister was significantly increased, and expansion of Haemophilus and Propionibacterium characterized UC. Compared to healthy individuals, fecal microbiota of IBD and IBS patients had increased abundance of Proteobacteria, Enterobacteriaceae, in particular. Shift toward reduction of Adlercreutzia and butyrate-producing taxa was found in feces of IBD patients. Microbiota alterations detected in newly diagnosed treatment-naïve adult patients indicate that the microbiota changes are set and detectable at the disease onset and likely have a discerning role in IBD pathophysiology. Our results justify further investigation of the taxa discriminating between disease groups, such as H. parainfluenzae, R. gnavus, Turicibacteriaceae, Dialister, and Adlercreutzia as potential biomarkers of the disease.