In the present study, we isolated a potent endophytic fungus from the roots of Withania somnifera. The endophytic fungal strain was authenticated as Penicillium ramusculum SVWS3 based on morphological and molecular sequencing using four gene data and phylogenetic analyses. In vitro cytotoxicity studies unveiled the remarkable cytotoxic potential of the crude extract derived from P. ramusculum, exhibiting dose-dependent effects on MDA-MB-468 and MCF-7 cells. At a concentration of 100 µg/mL, the crude extract resulted in cell viability of 29.78% for MDA-MB-468 cells and 14.61% for MCF-7 cells. The IC50 values were calculated as 62.83 ± 0.93 µg/mL and 17.23 ± 1.43 µg/mL, respectively for MDA-MB-468 and MCF-7 cells. Caspase activation assay established the underlying mechanism of the crude extract depicting the activation of caspases 3 and 7, indicating the induction of apoptosis in MCF-7 cells. Chemotaxonomic profiling elucidated the ability of P. ramusculum to synthesize a diverse array of bioactive compounds, including Fasoracetam, Tryprostatin B, Odorinol, Thyronine, Brevianamide F, Proglumide, Perlolyrine, Tyrphostin B48, Baptifoline, etc. Molecular docking studies inferred that Baptifoline, Brevianamide F, Odorinol, Perlolyrine, Thyronine, Tryphostin B48, and Tryprostatin B were the lead compounds that could effectively interact with the five selected target receptors of breast cancer, further surpassing the positive controls analyzed. Pharmacokinetic profiling revealed that Baptifoline, Odorinol, and Thyronine depicted an excellent therapeutic profile of druggability. These findings collectively substantiate the anticancer activity of bioactive metabolites synthesized by P. ramusculum SVWS3. Hence, the endophytic P. ramusculum SVWS3 can be an authentic source for developing novel chemotherapeutic drug formulations.Supplementary InformationThe online version contains supplementary material available at 10.1007/s13205-023-03906-3.