Triptolide (TP) is a diterpene triepoxide with various biological activities, but its clinical applications have been limited by potential hepatotoxicity, which can be attributed to T helper 17 (Th17)/T regulatory (Treg) cell imbalance. Quercetin (QE), a natural flavonoid, has been reported to have many benefits and medicinal properties, including hepatoprotective activity against TP-induced liver injury. However, the hepatoprotection mechanisms have not been clarified. The present study was designed to explore the protective effect and the mechanism of QE against TP-induced liver injury. Treatment with QE (20, 50 and 80 mg/kg) prior to TP administration restored TP-induced alterations in a certain dose range indicating that QE was able to inhibit TP-induced liver injury. One mechanism underlying this effect was the shifting balance in Th17 and Treg cells from Th17 dominance to Treg dominance. Furthermore, QE markedly decreased the expression level of the Th17-related pro-inflammatory cytokines interleukin (IL)-17 and IL-6, as well as the Th17 transcription factor retinoid-related orphan receptor-γt (ROR-γt). TP induced downregulation in the expression of anti-inflammatory cytokine IL-10, but the expression of Treg transcription factor forkhead/winged-helix family transcriptional repressor p3 (FoxP3) was restored by QE. In the process of exploring the possible hepatoprotective mechanisms of QE, we found that QE significantly reduced both protein and mRNA expression of Toll-like receptor 4 (TLR4), which in turn not only inactivated myeloid differentiation primary response gene 88 (MYD88), nuclear factor kappa B (NF-κB) and related inflammatory cytokines IL-6 and IL-17, but also simultaneously increased the levels of T-cell immunoglobulin and mucin domain-containing protein 3 (Tim-3). Furthermore, blocking of TLR4 enhanced the effect of QE in regulating the Th17/Treg imbalance. In summary, this report has demonstrated for the first time that the protection afforded by QE against TP-induced liver injury was associated with a shift in the balance of Th17 and Treg cells to Treg dominance, which was regulated by Tim-3 and TLR4-MyD88-NF-κB signaling pathway.