Water stress is one of the most important factors affecting the metabolic pathways in the plant and thus alters the synthesis and accumulation of natural compounds such as fatty acids and hydrocarbons in medicinal plants. This study aimed to investigate the effect of different levels of water stress (Full irrigation at field capacity, irrigation at 70% of field capacity and irrigation at 40% of field capacity) on fatty acid and hydrocarbon quantities of Milk thistle. Drought stress was applied at flowering stage. Then the oil extract was extracted from the seeds using Soxhlet method and analyzed by GC-MS. Information about the pathway of the reactions of the identified compounds was extracted from bioinformatics databases. The results showed that the yield of fatty acids and hydrocarbons increased with increasing drought stress intensity. The predominant fatty acids identified in Milk thistle oil extract was linoleic acid (15.2-27.4%) and its dominant hydrocarbon was dodecane (12.3-14.1%). The percentage of fatty acids detected under stress was reduced, probably due to their degradation into hydrocarbons to maintain osmotic pressure under dehydration.