Androgen therapy has been shown to alleviate type 2 diabetes mellitus (T2DM) but is also associated with severe side effects such as prostate cancer. The present study aims to identify the best hit selective androgen receptor (AR) modulator by in silico studies and then investigates its antidiabetic effects in high-fat diet- and streptozotocin (STZ)-induced T2DM male rat model. Molecular docking and molecular dynamics (MD) studies were carried out using Maestro 13.1 and Desmond (2023-2024). Cytotoxicity and insulin secretion were measured in MIN6 cell lines. T2DM was induced using high-fat diet (HFD) for 4 weeks, followed by single STZ (40 mg/kg, intraperitoneally). OneTouch Ultra glucometer was used to measure fasting blood glucose. Gene expression was determined using reverse transcription polymerase chain reaction. Histopathology was carried out using hematoxylin and eosin stain. Through molecular docking, we identify ligandrol as a potential hit. Ligandrol showed a good binding affinity (-10.74 kcal/mol). MD showed that ligandrol is stable during the 100 ns simulation. Ligandrol increases insulin secretion in a dose-dependent manner in vitro in 2 h. Ligandrol (0.3 and 1 mg/kg, orally) significantly decreased the body weight and fasting blood glucose levels compared with the HFD and STZ group. Gene expression showed that ligandrol significantly increased the AR-targeted gene, neurogenic differentiation 1, compared with the HFD and STZ group. Histopathological staining studies showed that ligandrol prevents pancreatic islet degeneration compared with the HFD and STZ group. Our findings suggest that ligandrol's protective effect on pancreatic islets leading to its antidiabetic effect occurs through the activation of AR.