The release of potent pro-inflammatory mediators is crucial to mounting an efficient host response during infection. However, excessive inflammation may lead to deleterious tissue damage. This is highlighted in severe pneumococcal pneumonia, in which the delicate balance between a robust inflammatory response necessary to kill pneumococci and the loss of organ function determines the outcome of the disease. We assessed the regulation of the potent anti-inflammatory cytokine interleukin (IL)-10 in pneumococcal infection via Western blot, ELISA and chromatin immunoprecipitation analysis. Streptococcus pneumoniae induced IL-10 expression in mouse lungs and human lung epithelial cells. Pneumococcal infection resulted in a strong induction of Krueppel-like factor (KLF)4 expression in vivo and in vitro. The induction of both IL-10 and KLF4 is mediated by a pathway involving bacterial DNA, Toll-like receptor (TLR)9, MyD88 and Src kinase. KLF4 is recruited to the il10 promoter, and small-interfering RNA-mediated knockdown of KLF4 expression blocked IL-10 expression during pneumococcal infection. In conclusion, KLF4 is induced in a bacterial DNA-TLR9-Src-dependent manner and regulates IL-10 expression, linking the detection of bacterial DNA by TLR9 to the control of an inflammatory response.