The main protease (Mpro) of the novel coronavirus SARS-CoV-2, which causes the COVID-19 pandemic, is responsible for the maturation of its key proteins. Thus, inhibiting SARS-CoV-2 Mpro could prevent SARS-CoV-2 from multiplying. Because new inhibitors require thorough validation, repurposing current drugs could help reduce the validation process. Many recent studies used molecular docking to screen large databases for potential inhibitors of SARS-CoV-2 Mpro. However, molecular docking does not consider molecular dynamics and thus can be prone to error. In this work, we developed a protocol using free energy perturbation (FEP) to assess the potential inhibitors of SARS-CoV-2 Mpro. We first tested both molecular docking and FEP on a set of 11 inhibitors of SARS-CoV-2 Mpro with experimentally determined inhibitory data. The experimentally deduced binding free energy exhibits significantly stronger correlation with that predicted by FEP (R = 0.94 ± 0.04) than with that predicted by molecular docking (R = 0.82 ± 0.08). This result clearly shows that FEP is the most accurate method available to estimate the binding affinity of a ligand to SARS-CoV-2 Mpro. We subsequently used FEP to validate the top 33 compounds screened with molecular docking from the ZINC15 database. Thirteen of these compounds were predicted to have strong binding affinity for SARS-CoV-2 Mpro, most of which are currently used as drugs for various diseases in humans. Notably, delamanid, an anti-tuberculosis drug, was predicted to inhibit SARS-CoV-2 Mpro in the nanomolar range. Because both COVID-19 and tuberculosis are lung diseases, delamanid has higher probability to be suitable for treating COVID-19 than other predicted compounds. Analysis of the interactions between SARS-CoV-2 Mpro and the top inhibitors revealed the key residues involved in the binding, including the catalytic dyad His14 and Cys145, which is consistent with the structural studies reported recently.