The aim of this study was to expose anti-obesity effect of Gnaphalium affine (GA) and its underlying mechanism by combining biochemical analysis, 16S rRNA sequencing and untargeted metabolomics. The results showed GA alleviated high-fat diet (HFD)-mediated oxidative stress, fat accumulation and inflammation. Moreover, GA improved gut barrier and immunity in HFD-fed mice through up-regulating tight junction protein, decreasing Lipopolysaccharide (LPS) level and inhibiting pro-inflammatory makers production in LPS/ toll-like receptor 4 (TLR4) / Myd88 / NF-κB pathway. Additionally, GA and its extracts altered composition and metabolism of gut microbiota. GA promoted abundances of Dubosiella and decreased abundance of Alistipes in HFD-fed mice, which were closely linked to 5-Hydroxy-6,7-dimethoxylflavone from GA and levels of weight, inflammatory markers, gut microbial metabolites of mice. Collectively, GA offers its anti-obesity properties through regulating gut microbiota by mucosal barrier functions, indicating that GA and its natural compounds hold great potential as a functional food ingredient.