Mycoplasma pneumoniae (Mp), a common cause of pneumonia, is associated with asthma; however, the mechanisms underlying this association remain unclear. We investigated the cellular immune response to Mp in mice. Intranasal inoculation with Mp elicited infiltration of the lungs with neutrophils, monocytes and macrophages. Systemic depletion of macrophages, but not neutrophils, resulted in impaired clearance of Mp from the lungs. Accumulation and activation of macrophages were decreased in the lungs of MyD88(-/-) mice and clearance of Mp was impaired, indicating that MyD88 is a key signaling protein in the anti-Mp response. MyD88-dependent signaling was also required for the Mp-induced activation of NFκB, which was essential for macrophages to eliminate the microbe in vitro. Thus, MyD88-NFκB signaling in macrophages is essential for clearance of Mp from the lungs.