Many diseases, including diabetes, are involved in the development of liver disorders through changes in the expression of genes such as apoptosis-related genes. In the present study, the effect of Thymus vulgaris (T. vulgaris) on hepatic enzyme activity and apoptosis-related gene expression in streptozotocin (STZ)-induced diabetic rats was examined. In this study, 50 adult male Wistar rats weighing approximately 200–220 g were divided into five groups. Diabetes was induced by an intraperitoneal injection of STZ (60 mg/kg). Following 18 days, all the animals in different groups were weighed and blood samples were taken from their cardiac veins. Gas chromatography-mass spectrometry (GC-MS) analysis revealed 45 different compounds in the T. vulgaris, including thymol (39.1%), p-cymene (20.63%), and γ-terpinene (14.85%). The results showed a significant increase in liver enzymes (aminotransferase (AST), alanine aminotransferase (ALT), and alkaline phosphatase (ALP)) in diabetic or STZ mice compared to the control group (healthy mice) (
P
<
0.0001
). The levels of AST, ALT, and ALP in rats treated with 200 mg/kg and 400 mg/kg of T. vulgaris extract showed a significant decrease in these enzymes in comparison with diabetic rats (
P
<
0.0001
). The expression of caspase 3 and 9 genes in the groups treated with thyme significantly decreased compared to diabetic mice (
P
<
0.0001
), and the expression of B-cell lymphoma-2 (Bcl-2) in the group receiving 400 mg/kg of thyme significantly increased compared to diabetic mice (
P
<
0.0001
). Due to its antioxidant compounds, thyme improves the liver tissue cells in STZ-induced diabetic mice by reducing caspases 3 and 9 as well as increasing Bcl-2.