The main protease, M(pro) (or 3CL(pro)) in SARS-CoV-2 is a viable drug target because of its essential role in the cleavage of the virus polypeptide. Feline infectious peritonitis, a fatal coronavirus infection in cats, was successfully treated previously with a prodrug GC376, a dipeptide-based protease inhibitor. Here, we show the prodrug and its parent GC373, are effective inhibitors of the M(pro) from both SARS-CoV and SARS-CoV-2 with IC50 values in the nanomolar range. Crystal structures of SARS-CoV-2 M(pro) with these inhibitors have a covalent modification of the nucleophilic Cys145. NMR analysis reveals that inhibition proceeds via reversible formation of a hemithioacetal. GC373 and GC376 are potent inhibitors of SARS-CoV-2 replication in cell culture. They are strong drug candidates for the treatment of human coronavirus infections because they have already been successful in animals. The work here lays the framework for their use in human trials for the treatment of COVID-19.