Riboswitches are regulatory elements modulating gene expression in response to specific metabolite binding. It has been recently reported that riboswitch agonists may exhibit antimicrobial properties by binding to the riboswitch domain. Guanine riboswitches are involved in the regulation of transport and biosynthesis of purine metabolites, which are critical for the nucleotides cellular pool. Upon guanine binding, these riboswitches stabilize a 5'-untranslated mRNA structure that causes transcription attenuation of the downstream open reading frame. In principle, any agonistic compound targeting a guanine riboswitch could cause gene repression even when the cell is starved for guanine. Antibiotics binding to riboswitches provide novel antimicrobial compounds that can be rationally designed from riboswitch crystal structures. Using this, we have identified a pyrimidine compound (PC1) binding guanine riboswitches that shows bactericidal activity against a subgroup of bacterial species including well-known nosocomial pathogens. This selective bacterial killing is only achieved when guaA, a gene coding for a GMP synthetase, is under the control of the riboswitch. Among the bacterial strains tested, several clinical strains exhibiting multiple drug resistance were inhibited suggesting that PC1 targets a different metabolic pathway. As a proof of principle, we have used a mouse model to show a direct correlation between the administration of PC1 and the reduction of Staphylococcus aureus infection in mammary glands. This work establishes the possibility of using existing structural knowledge to design novel guanine riboswitch-targeting antibiotics as powerful and selective antimicrobial compounds. Particularly, the finding of this new guanine riboswitch target is crucial as community-acquired bacterial infections have recently started to emerge.