Intrauterine infection during pregnancy can enhance the uterine contractions. A two-pore K+ channel TREK1 is crucial for maintaining uterine quiescence and reducing contractility, with its properties regulated by pH changes in cell microenvironment. Meanwhile, the sodium hydrogen exchanger 1 (NHE1) plays a pivotal role in modulating cellular pH homeostasis, and its activation increases smooth muscle tension. By establishing an infected mouse model of Escherichia coli ( E. coli) and lipopolysaccharide (LPS), we employed Western blotting, RT-qPCR, and immunofluorescence to detect changes of TREK1 and NHE1 expression in the myometrium, and isometric recording measured the uterus contraction. The NHE1 inhibitor cariporide was used to explore to the effect of NHE1 on TREK1. Finally, cell contraction assay and siRNA transfection were performed to clarify the relationship between NHE1 and TREK1 in vitro. We found that the uterine contraction was notably enhanced in infected mice with E. coli and LPS administration. Meanwhile, TREK1 expression was reduced, while NHE1 expression was upregulated in infected mice. Cariporide alleviated the increased uterine contraction and promoted myometrium TREK1 expression in LPS-injected mice. Furthermore, suppression of NHE1 with siRNA transfection inhibited the contractility of uterine smooth muscle cells, and activate the TREK1. Altogether, our findings indicate that infection increases the uterine contraction by down-regulating myometrium TREK1 in mice, and the inhibition of TREK1 is attributed to the activation of NHE1.