This study explores the insecticidal efficacy of ethanol extracts -obtained from the fruits and seeds of Melia azedarach (MAFS) -against Bactrocera cucurbitae. We assessed the effectiveness of the MAFS extracts at concentrations ranging from 1 to 625 ppm using both laboratory and greenhouse models. Sofri protein 10 DD (1.2 liters/ha) served as the standard insecticide, while water functioned as the negative control. Key parameters evaluated include pupation period, germination time, quantities of pupae and adult individuals, and the severity of damage to bitter melon fruits. In the laboratory model, MAFS significantly prolonged the pupation period (p < 0.05), reduced pupal numbers (p < 0.05), and affected the pupation percentage of B. cucurbitae (p < 0.05). In addition, the germination time (p < 0.05) and proportion of adult B. cucurbitae emergence (p < 0.05) were also significantly impacted. In the greenhouse experiment, MAFS significantly reduced the quantity of B. cucurbitae eggs on bitter melon plants (p < 0.05), resulting in a notable decrease in both larval (p < 0.05) and pupal quantities (p < 0.05). The inhibitory effects of MAFS on larval (p < 0.05) and pupal quantities (p < 0.05), as well as survival from the larval to adult stage, were equivalent to the sofri protein (p < 0.05). MAFS effectively mitigated the severity of damage to bitter melon fruits caused by B. cucurbitae (p < 0.05). Moreover, MAFS exhibits significant effects throughout the various developmental stages of B. cucurbitae. These findings support the potential of MAFS ethanol extracts as an efficient and eco-friendly solution for pest infestation management.