To investigate the protective effect of glutamine (Gln) on intestinal injury and the bacterial community in rats exposed to hypobaric hypoxia environment. Sprague-Dawley rats were divided into control, hypobaric hypoxia (HH), and hypobaric hypoxia + Gln (5.0 g/kg BW·d) (HG) groups. On the first 3 d, all rats were placed in a normal environment. After the third day, the HH and HG groups were transferred into a hypobaric chamber at a simulated elevation of 7000 m for 5 d. The rats in the HG group were given Gln by gavage daily for 8 d. The rats in the control and HH groups were treated with the same volume of saline. The intestinal morphology, serum levels of malondialdehyde (MDA), superoxide dismutase (SOD), interleukin-6 (IL-6), tumor necrosis factor-α (TNF-α), interferon-gamma (IFN-γ) and diamino oxidase (DAO) were examined. We also evaluated the expression levels of occludin, toll-like receptor 4 (TLR4), nuclear factor-κB p65 (NF-κB p65) and myeloid differentiation factor 88 (MyD88), and examined the bacterial community in caecal contents. Hypobaric hypoxia induced the enlargement of the heart, liver, lung and kidney, and caused spleen atrophy. Intestinal villi damage was also observed in the HH group. Supplementation with Gln significantly alleviated hypobaric-induced damage to main organs including the intestine, increased serum SOD (1.14 ± 0.03 vs 0.88 ± 0.04, P < 0.05) and MDA (8.35 ± 1.60, P < 0.01) levels and decreased serum IL-6 (1172.13±30.49 vs 1407.05 ± 34.36, P < 0.05), TNF-α (77.46 ± 0.78 vs 123.70 ± 3.03, P < 0.001), IFN-γ (1355.42 ± 72.80 vs 1830.16 ± 42.07, P < 0.01) and DAO (629.30 ± 9.15 vs 524.10 ± 13.34, P < 0.001) levels. Moreover, Gln significantly increased occludin (0.72 ± 0.05 vs 0.09 ± 0.01, P < 0.001), TLR4 (0.15 ± 0.05 vs 0.30 ±0.09, P < 0.05), MyD88 (0.32 ± 0.08 vs 0.71 ± 0.06, P < 0.01), and NF-κB p65 (0.16 ± 0.04 vs 0.44 ± 0.03, P < 0.01) expression levels and improved the intestinal bacterial community. Gln treatment protects from intestinal injury and regulates the gut flora imbalance in hypoxia environment. These effects may be related to the TLR4/MyD88/NF-κB signaling pathway.