Th17 cells have recently emerged as a major player in inflammatory and autoimmune diseases via the production of pro-inflammatory cytokines IL-17, IL-17F, and IL-22. The differentiation of Th17 cells and the associated cytokine production is directly controlled by RORγt. Here we show that ursolic acid (UA), a small molecule present in herbal medicine, selectively and effectively inhibits the function of RORγt, resulting in greatly decreased IL-17 expression in both developing and differentiated Th17 cells. In addition, treatment with UA ameliorated experimental autoimmune encephalomyelitis. The results thus suggest UA as a valuable drug candidate or leading compound for developing treatments of Th17-mediated inflammatory diseases and cancer.