Bovine mastitis caused by Streptococcus dysgalactiae (S. dysgalactiae) is usually treated with antibiotics, which may potentially increase drug resistance as the abuse. NZ2114, a variant of fungal defensin plectasin, displayed a potent antibacterial activity against S. dysgalactiae. The inhibition/eradication effect of the antimicrobial peptide NZ2114 on the early/mature biofilm of S. dysgalactiae CVCC 3938 was evaluated, as well as the elimination of bacteria in mature biofilms. In this study, NZ2114 displayed potent antibacterial activity against S. dysgalactiae CVCC 3938 and three clinical isolated S. dysgalactiae strains (0.11-0.45 μM). The early biofilm inhibition of S. dysgalactiae CVCC 3938 was 55.5–85.9% after treatment with NZ2114 at concentrations of 1–16 × MIC, which was better than that of vancomycin at the same concentration. The mature biofilm eradication rate was up to 92.7–97.6% with the increasing concentration (2–16 × MIC) of NZ2114, and the eradication rate did not change significantly with further increase of NZ2114 concentration, while the biofilm eradication rate of vancomycin-treated group at the same concentration remained at 92.5%. NZ2114 reduced the number of persister bacteria in biofilm. Scanning electron microscopy (SEM) and confocal laser scanning microscopy (CLSM) further demonstrated that NZ2114 could effectively reduce the biofilm thickness and bacterial number of S. dysgalactiae CVCC 3938. In vivo therapeutic effect of NZ2114 on murine mastitis model showed that NZ2114 was better than vancomycin in alleviating mammary gland inflammation by regulating cytokines production, inhibiting bacterial proliferation, and reducing the number of mammary gland bacteria. These data suggested that NZ2114 is a potential peptide candidate for the treatment of mastitis.