The hallmark of many bacterial infections is pain. The underlying mechanisms of pain during live pathogen invasion are not well understood. Here, we elucidate key molecular mechanisms of pain produced during live methicillin-resistant Staphylococcus aureus (MRSA) infection. We show that spontaneous pain is dependent on the virulence determinant agr and bacterial pore-forming toxins (PFTs). The cation channel, TRPV1, mediated heat hyperalgesia as a distinct pain modality. Three classes of PFTs-alpha-hemolysin (Hla), phenol-soluble modulins (PSMs), and the leukocidin HlgAB-directly induced neuronal firing and produced spontaneous pain. From these mechanisms, we hypothesized that pores formed in neurons would allow entry of the membrane-impermeable sodium channel blocker QX-314 into nociceptors to silence pain during infection. QX-314 induced immediate and long-lasting blockade of pain caused by MRSA infection, significantly more than lidocaine or ibuprofen, two widely used clinical analgesic treatments.