Liver diseases present a significant public health burden worldwide. Although the mechanisms of liver diseases are complex, it is generally accepted that inflammation is commonly involved in the pathogenesis. Ongoing inflammatory responses exacerbate liver injury, or even result in fibrosis and cirrhosis. Here we report that roscovitine, a cyclin-dependent kinase (CDK) inhibitor, exerts beneficial effects on acute and chronic liver inflammation as well as fibrosis. Animal models of lipopolysaccharide (LPS)/d-galactosamine- and acute or chronic CCl4-induced liver injury showed that roscovitine administration markedly attenuated liver injury, inflammation and histological damage in LPS/d-galactosamine- and CCl4-induced acute liver injury models, which is consistent with the results in vitro. RNA sequencing (RNA-seq) analysis showed that roscovitine treatment repressed the transcription of a broad set of pro-inflammatory genes involved in many aspects of inflammation, including cytokine production and immune cell proliferation and migration, and inhibited the TGF-β signaling pathway and the biological process of tissue remodeling. For further validation, the beneficial effect of roscovitine against inflammation was evaluated in chronic CCl4-challenged mice. The anti-inflammation effect of roscovitine was observed in this model, accompanied with reduced liver fibrosis. The anti-fibrotic mechanism involved inhibition of profibrotic genes and blocking of hepatic stellate cell (HSC) activation. Our data show that roscovitine administration protects against liver diseases through inhibition of macrophage inflammatory actions and HSC activation at the onset of liver injury.