Mesalamine has been well used in the improvement of ulcerative colitis (UC) in clinics, however, the underlying mechanisms were not well illustrated. To explore its efficacy from the perspective of gut microbiota and related metabolites, we employed 16S rRNA sequencing and metabolomics approaches in stool samples across 14 normal healthy controls (NC group), 10 treatment-naïve UC patients (UC group) and 14 UC patients responded to mesalamine treatment (mesalamine group). We noted that the gut microbiota diversity and community composition were remarkably perturbed in UC group and partially restored by mesalamine treatment. The relative abundance of 192 taxa in genus level were significantly changed in UC group, and 168 genera were significantly altered after mesalamine intervention. Meanwhile, a total of 127 metabolites were significantly changed in UC group and 129 metabolites were significantly altered after mesalamine treatment. Importantly, we observed that many candidates including 49 genera (such as Escherichia-shigella, Enterococcus and Butyricicoccus) and 102 metatoblites (such as isoleucine, cholic acid and deoxycholic acid) were reversed by mesalamine. Spearman correlation analysis revealed that most of the candidates were significantly correlated with Mayo score of UC, and the relative abundance of specific genera were significant correlated with the perturbation of metabolites. Pathway analysis demonstrated that genera and metabolites candidates were enriched in many similar molecular pathways such as amino acid metabolism and secondary metabolites biosynthesis. Importantly, ROC curve analysis identified a gut microbiota signature composed of five genera including Escherichia-Shigella, Streptococcus, Megamonas, Prevotella_9 and [Eubacterium] _coprostanoligenes _group which might be used to distinguish UC group from both NC and mesalamine group. In all, our results suggested that mesalamine might exert a beneficial role in UC by modulating gut microbiota signature with correlated metabolites in different pathways, which may provide a basis for developing novel candidate biomarkers and therapeutic targets of UC.