Autophagy is a newly recognized innate defense mechanism, acting as a cell-autonomous system for elimination of intracellular pathogens. The signals and signalling pathways inducing autophagy in response to pathogen invasion are presently not known. Here we show that autophagy is controlled by recognizing conserved pathogen-associated molecular patterns (PAMPs). We screened a PAMP library for effects on autophagy in RAW 264.7 macrophages and found that several prototype Toll-like receptor (TLR) ligands induced autophagy. Single-stranded RNA and TLR7 generated the most potent effects. Induction of autophagy via TLR7 depended on MyD88 expression. Stimulation of autophagy with TLR7 ligands was functional in eliminating intracellular microbes, even when the target pathogen was normally not associated with TLR7 signalling. These findings link two innate immunity defense systems, TLR signalling and autophagy, provide a potential molecular mechanism for induction of autophagy in response to pathogen invasion, and show that the newly recognized ability of TLR ligands to stimulate autophagy can be used to treat intracellular pathogens.