Staphylococcus aureus is the leading cause of hospital-acquired infections in the United States. The emergence of multidrug-resistant strains of S. aureus has created an urgent need for new antibiotics. Staphylococcus aureus uses the sortase A enzyme to display surface virulence factors suggesting that compounds that inhibit its activity will function as potent anti-infective agents. Here, we report the identification of several inhibitors of sortase A using virtual screening methods that employ the relaxed complex scheme, an advanced computer-docking methodology that accounts for protein receptor flexibility. Experimental testing validates that several compounds identified in the screen inhibit the activity of sortase A. A lead compound based on the 2-phenyl-2,3-dihydro-1H-perimidine scaffold is particularly promising, and its binding mechanism was further investigated using molecular dynamics simulations and conducting preliminary structure–activity relationship studies.