A pH-responsive copolymer hydrogel was synthesized based on methyl methacrylate (MMA) and methacrylic acid (MAA) as monomers, and was adopted as a nanoreactor for assembling Ag nanoparticles. Fourier transform infrared spectroscope (FTIR), scanning electron microscopy (SEM), transmission electron microscope (TEM), UV-visible spectroscopy (UV-Vis) and thermogravimetric analysis (TGA) were used to fully characterize the formation of silver nanoparticles in P(MMA-co-MAA) hydrogels. The experimental results showed that the P(MMA-co-MAA) hydrogels assume a three-networks architecture in morphologies, and that nearly spherical Ag nanoparticles are formed in these hydrogel networks; the size of these Ag nanoparticles varies with the system composition. The swelling kinetics investigations demonstrated that the equilibrium swelling ratio (ESR) of the P(MMA-co-MAA)/Ag hydrogels depended on the content of the MAA and pH of the buffer solutions, and the ESR values were reduced with increasing MAA contents. The antibacterial properties against both S. aureus and B. subtilis bacteria demonstrated that the P(MMA-co-MAA)/silver nanocomposite hydrogels had higher antimicrobial efficacy than the pure P(MMA-co-MAA) counterparts. Therefore, the nanocomposite hydrogels turned out to be a potentially smart material in the range of applications of antibacterial activity.