Staphylococcus aureus (S. aureus), a commensal organism found on the human skin, is commonly associated with nosocomial infections and exhibits virulence mediated by toxins and resistance to antibiotics. The global threat of antibiotic resistance has necessitated antimicrobial stewardship to improve the safe and appropriate use of antimicrobials; hence, there is an urgent demand for the advanced, cost-effective, and rapid detection of specific bacteria. In this regard, we aimed to selectively detect S. aureus using surface molecularly imprinted magnetic nanoparticles templated with a well-known biomarker protein A, specific to S. aureus. Herein, a highly selective surface molecularly imprinted polymeric thin layer was created on ∼250 nm magnetic nanoparticles (MNPs) through the immobilization of protein A to aldehyde functionalized MNPs, followed by monomer polymerization and template washing. This study employs the rational selection of monomers based on their computationally predicted binding affinity to protein A at multiple surface residues. The resulting MIPs from rationally selected monomer combinations demonstrated an imprinting factor as high as ∼5. Selectivity studies revealed MIPs with four-fold higher binding capacity (BC) to protein A than other non-target proteins, such as lysozyme and serum albumin. In addition, it showed significant binding to S. aureus, whereas negligible binding to other non-specific Gram-negative, i.e. Escherichia coli (E. coli), Pseudomonas aeruginosa (P. aeruginosa), and Gram-positive, i.e. Bacillus subtilis (B. subtilis), bacteria. This MIP was employed for the capture and specific detection of fluorescently labeled S. aureus. Quantitative detection was performed using a conventional plate counting technique in a linear detection range of 101-107 bacterial cells. Remarkably, the MIPs also exhibited approximately 100% cell recovery from milk samples spiked with S. aureus (106 CFU mL-1), underscoring its potential as a robust tool for sensitive and accurate bacterial detection in dairy products. The developed MIP exhibiting high affinity and selective binding to protein A finds its potential applications in the magnetic capture and selective detection of protein A as well as S. aureus infections and contaminations.