The global burden of liver disease is enormous, which highlights the need for effective hepatoprotective agents. It was reported that allicin exhibits protective effects against a range of diseases. In this study, we further evaluated allicin's effect and mechanism in acute hepatic injury. Liver injury in mice was induced by intraperitoneal injection with 1% CCl4 (10 mL/kg/day). When the first dose was given, CCl4 was given immediately after administration of different doses of allicin (40, 20, and 10 mg/kg/day) as well as compound glycyrrhizin (CGI, 80 mg/kg/day), and then different doses of allicin (40, 20, and 10 mg/kg/day) as well as compound glycyrrhizin (CGI, 80 mg/kg/day) were administrated every 12 h. The animals were dissected 24 h after the first administration. The findings demonstrated a significant inhibition of CCl4-induced acute liver injury following allicin treatment. This inhibition was evidenced by notable reductions in serum levels of transaminases, specifically aspartate transaminase, along with mitigated histological damage to the liver. In this protective process, allicin plays the role of reducing the amounts or the expression levels of proinflammatory cytokines, IL-1β, IL-6. Furthermore, allicin recovered the activities of the antioxidant enzyme catalase (CAT) and reduced the production of malondialdehyde (MDA) in a dose-dependent manner, and also reduced liver Caspase 3, Caspase 8, and BAX to inhibit liver cell apoptosis. Further analysis showed that the administration of allicin inhibited the increased protein levels of Nuclear factor-erythroid 2-related factor 2 (Nrf2) and NAD(P)H:quinone oxidoreductase 1 (NQO1), which is related to inflammation and oxidative stress. The in vitro study of the LPS-induced RAW264.7 inflammatory cell model confirmed that allicin can inhibit important inflammation-related factors and alleviate inflammation. This research firstly clarified that allicin has a significant protective effect on CCl4-induced liver injury via inhibiting the inflammatory response and hepatocyte apoptosis, alleviating oxidative stress associated with the progress of liver damage, highlighting the potential of allicin as a hepatoprotective agent.