The highly pathogenic SARS-CoV-2 causes COVID-19, which threatens global public health and socio-economic stability through persistent transmission and mutation. Effective therapeutics against SARS-CoV-2 and its variants are urgently needed. The main protease (Mpro), highly conserved among coronaviruses and lacking human homologs, is pivotal for viral replication, making it an attractive antiviral target. CCF0058981, a novel non-covalent inhibitor developed based on the ML300 scaffold, demonstrates potent low-nanomolar inhibitory activity against SARS-CoV-2 Mpro and sub-micromolar antiviral efficacy against SARS-CoV-2. Its non-covalent binding mechanism effectively mitigates the off-target risks commonly associated with traditional covalent inhibitors, thereby providing a versatile scaffold for the development of highly safe and effective anti-coronavirus therapeutics. However, the structural basis underlying CCF0058981's inhibitory mechanism against SARS-CoV-2 Mpro remains to be elucidated. Here, we report for the first time two crystal structures of Mpro from SARS-CoV-2 and SARS-CoV in complex with the inhibitor CCF0058981. Detailed crystal structure analysis reveals that CCF0058981 occupies the catalytic pocket of Mpro via conserved hydrogen bonds and hydrophobic interactions. The superimposition analysis of the reported crystal structures also reveals that CCF0058981 maintains stable binding to the Mpro mutants (M49I and V186F), demonstrating its potential to combat drug resistance, demonstrating its potential to counteract drug resistance. Molecular dynamics simulations further validate the stability of the inhibitor-protease complex. These findings provide mechanistic insights into CCF0058981's inhibition and support developing broad-spectrum coronavirus therapeutics.