The medicinal properties of Ashwagandha (Withania somnifera L. Dunal) are attributed to withanolides, which belong to the triterpenoid steroidal lactones class of compounds. Though it is proposed that intermediates of the universal phytosterol pathway are utilized by cytochrome P450 (CYP450) enzymes to form withanolides, studies on the functional characterization of these enzymes have been sparse. This study reports the functional characterization of a CYP450 candidate from W. somnifera, WsCYP71B35 that exhibited induced expression in response to methyl jasmonate treatment and showed higher expression in tissues that accumulate withanolides. Biochemical assay with yeast microsomal fraction expressing recombinant WsCYP71B35 indicated no activity when phytosterols and their intermediate 24‐methylene cholesterol were used as substrates. However, WsCYP71B35 catalyzed product formation with withaferin A, withanolide A, withanolide B, and withanoside IV among the tested substrates. Moreover, virus‐induced gene silencing (VIGS) and transient overexpression of WsCYP71B35 in W. somnifera leaves modulated the levels of withaferin A, withanolide A, and withanolide B, indicating the role of WsCYP71B35 in withanolides pathway. Furthermore, VIGS of WsCYP71B35 in W. somnifera reduced its tolerance to Pseudomonas syringae (DC3000) infection, whereas overexpression enhanced the tolerance to the bacterium in W. somnifera and transgenic tobacco. Overall, these results provide insights into the role of W. somnifera WsCYP71B35 in withanolides biosynthesis and bacterial defence.