Drug-induced liver injury (DILI) is a serious complication of many drugs, including carbamazepine; this study investigates the protective effect of pentoxifylline (PTX) against DILI induced by carbamazepine in rat models by attenuating CYP3A4 and NF-κB gene expression. Forty rats were divided into five groups: the control group received no treatment, the induction group received 50 mg/kg carbamazepine orally for 28 days, and three groups received PTX (100, 200, and 300 mg/kg) once daily for one hour before carbamazepine induction for 28 days. Then, the rats were euthanized, and blood and liver tissue were collected for biochemical, gene expression, and histopathology. PTX attenuates the carbamazepine-induced increased CYP3A4 and NF-κB gene expression, with the highest dose showing the best result. PTX also reduced aspartate aminotransferase, alanine aminotransferase, and malondialdehyde, while glutathione levels increased. In conclusion, PTX is highly efficacious in preventing and restoring the liver cells’ normal morphology and cellular function caused by carbamazepine hepatotoxicity. A possible mechanism of the PTC effect is hindering oxidative stress by scavenging free radicals and enhancing the body’s natural defense antioxidant system. Additionally, it exerts an anti-inflammatory impact by modulating NF-κB gene expression.