Mycoplasma pneumoniae is a major cause of respiratory disease in humans and accounts for as much as 20% of all community-acquired pneumonia. Existing mycoplasma diagnosis is primarily limited by the poor success rate at culturing the bacteria from clinical samples. There is a critical need to develop a new platform for mycoplasma detection that has high sensitivity, specificity, and expediency. Here we report the layer-by-layer (LBL) encapsulation of M. pneumoniae cells with Ag nanoparticles in a matrix of the polyelectrolytes poly(allylamine hydrochloride) (PAH) and poly(styrene sulfonate) (PSS). We evaluated nanoparticle encapsulated mycoplasma cells as a platform for the differentiation of M. pneumoniae strains using surface enhanced Raman scattering (SERS) combined with multivariate statistical analysis. Three separate M. pneumoniae strains (M129, FH and II-3) were studied. Scanning electron microscopy and fluorescence imaging showed that the Ag nanoparticles were incorporated between the oppositely charged polyelectrolyte layers. SERS spectra showed that LBL encapsulation provides excellent spectral reproducibility. Multivariate statistical analysis of the Raman spectra differentiated the three M. pneumoniae strains with 97-100% specificity and sensitivity, and low (0.1-0.4) root mean square error. These results indicated that nanoparticle and polyelectrolyte encapsulation of M. pneumoniae is a potentially powerful platform for rapid and sensitive SERS-based bacterial identification. © 2014 The Royal Society of Chemistry.