The growing occurrence of bacterial resistance has spawned the development of novel antimicrobial agents. Antimicrobial peptides, a class of small molecules with antimicrobial activity, have been regarded as the ideal alternatives to antibiotics. In this study, we amplified a new type of Zophobas atratus coleoptericin (denoted coleoptericin B) through rapid amplification of cDNA ends (RACE) PCR and expressed recombinant Z. atratus coleoptericin B (rZA-col B) by prokaryotic expression. Subsequently, we evaluated the antimicrobial effect and biocompatibility of rZA-col B in vivo, investigated its antimicrobial mechanism, and assessed its therapeutic effect in a murine model of mastitis caused by MDR Klebsiella pneumoniae. The in vivo studies demonstrated that rZA-col B possesses broad-spectrum antimicrobial activity against both Gram-positive and Gram-negative bacteria. It exhibited less than 1.5% haemolysis and 10% cytotoxicity, even at a concentration of 128 μM. Additionally, rZA-col B had a minimal risk of inducing drug resistance. Furthermore, rZA-col B could disrupt the integrity of bacterial membranes, induce membrane permeabilization and ultimately lead to bacterial death. Importantly, rZA-col B also alleviated mastitis caused by MDR K. pneumoniae in a murine model by enhancing bacterial clearance, reducing neutrophil infiltration, decreasing TNF-α and IL-1β expression, and protecting the mammary barrier. rZA-col B may be a promising antibacterial agent to combat MDR bacterial infection.