Functionalization of silk fibroin hydrogel with antimicrobial activity is essential for promoting the applications of this excellent biomaterial. In this work, a simple approach based on electrostatic interaction is adopted to produce antimicrobial silk hydrogel containing an antimicrobial peptide (AMP), polymyxin B, an important last-line antibiotic to treat multidrug-resistant bacterial superbugs. The polycationic property of this peptide and the negative charge of silk fibroin lead to strong interactions between them, as demonstrated by changes in nanofibril structure, gelation kinetics, ζ-potential, fluorescence emission, and rheological properties of the gel. The hydrogels loaded with polymyxin B demonstrated antimicrobial activity against two Gram-negative bacterial strains. A combination of the results from the different characterizations suggests that the optimal molar ratio of polymyxin B to silk fibroin is 1:2.5. As most AMPs are cationic, this electrostatic approach is suitable for the straightforward functionalization of inert silk hydrogel with other AMPs.