The establishment of rapid target identification and analysis methods for antibiotic resistance genes (ARGs) is urgently needed. In this study, we unprecedently designed a target-catalyzed hairpin assembly (CHA) electrochemiluminescent (ECL) biosensor for the ultrasensitive detection of ampicillin resistance genes (ARGAMP) based on a novel, efficient near-infrared ruthenium carbene complex/TPrA/PEI ternary ECL system with low oxidation potential. The ternary NIR-ECL system illustrated in this work displayed double ECL intensity in comparison with their corresponding traditional binary ECL system. The as-prepared ECL biosensor illustrated in this work demonstrates highly selective and sensitive determination of ARGAMP from 1 fM to 1 nM and a low detection limit of 0.23 fM. Importantly, it also exhibits good accuracy and stabilities to identify ARGAMP in plasmid and bacterial genome DNA, which demonstrates its excellent reliability and great potential in detecting ARGAMP in real environmental samples.