Since the emergence of a novel coronavirus disease (COVID-19) caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) was firstly reported from Wuhan, China, to date, neither a specific vaccine nor antiviral drug against SARS-CoV-2 is available. However, a combination of two HIV-1 protease inhibitors lopinavir and ritonavir has been found to be effective against SARS-CoV, and both drugs could bind well to the SARS-CoV 3C-like protease (SARS-CoV 3CLpro). In this work, molecular complexation between each inhibitor and the SARS-CoV-2 3CLpro was studied using all-atom molecular dynamics simulations, free energy calculations and pair interaction energy analyses based on the MM/PB(GB)SA and FMO-MP2/PCM/6-31G*. Both anti-HIV drugs interacted well with the residues at the active site of the SARS-CoV-2 3CLpro. Ritonavir showed somewhat higher atomic contacts, binding efficiency and key binding residues than that of lopinavir in correspondence with slightly less water accessibility at the 3CLpro active site. In addition, only ritonavir could interact with the oxyanion hole residues N142 and G143 via two hydrogen bond formations. The interactions in terms of electrostatics, dispersion and charge transfer played an important role in the drug binding. The obtained results demonstrated how repurposed anti-HIV drugs could be used to combat COVID-19.