There is an urgent need for anti-viral agents that treat SARS-CoV-2 infection. The shortest path to clinical use is repurposing of drugs that have an established safety profile in humans. Here, we first screened a library of 1,900 clinically safe drugs for inhibiting replication of OC43, a human beta-coronavirus that causes the common-cold and is a relative of SARS-CoV-2, and identified 108 effective drugs. We further evaluated the top 26 hits and determined their ability to inhibit SARS-CoV-2, as well as other pathogenic RNA viruses. 20 of the 26 drugs significantly inhibited SARS-CoV-2 replication in human lung cells (A549 epithelial cell line), with EC50 values ranging from 0.1 to 8 micromolar. We investigated the mechanism of action for these and found that masitinib, a drug originally developed as a tyrosine-kinase inhibitor for cancer treatment, strongly inhibited the activity of the SARS-CoV-2 main protease 3CLpro. X-ray crystallography revealed that masitinib directly binds to the active site of 3CLpro, thereby blocking its enzymatic activity. Mastinib also inhibited the related viral protease of picornaviruses and blocked picornaviruses replication. Thus, our results show that masitinib has broad anti-viral activity against two distinct beta-coronaviruses and multiple picornaviruses that cause human disease and is a strong candidate for clinical trials to treat SARS-CoV-2 infection.