The house flies Musca domestica )Diptera:musidae) are the primary carrier of many pathogens such as cholera, typhoid, anthrax, and others. The use of chemical pesticides as a basic method of control leads to many problems at the environmental and health level. The use of safe alternatives to chemical pesticides has become an urgent necessity. The research aims to find biological alternatives that are environment-friendly and non-pathogenic to humans in controlling house flies through the possibility of extracting and diagnosing some secondary metabolites produced by the fungus Metarhizium anisopliae and testing their effects on the second larval stage of house flies using different treatment methods that include direct spraying of the larvae, treating the food environment, and the dipping method. Secondary metabolites and toxins of Metarhizium anisopliae were extracted in liquid media PDB using a mixture of organic solvents such as ethyl acetate and methanol. The secondary metabolites were identified by gas chromatography-mass spectrometry (GC-MS). The results showed the identification of 10 chemical compounds, including phenol, 2,4-bis(1,1-dimethylethyl (C14H22O)., Diethyl Phthalate (C12H14O4), Hexadecanoic acid, methyl ester (C17H34O2 ), Phthalic acid, butyl undecyl ester (C23H36O4) , 9,12-Octadecanoic (Z,Z )-, methyl ester ( C19H34O2), 9-Octadecanoic acid, methyl ester, (C19H36O2), 9,12,15-Octadecanoic acid,methyl ester,(Z,Z,Z) (C19H32O2), Octadecanoic acid,methyl ester(C19H38O2), Oleic Acid (C24H38O4), 9-Octadecanoic acid (Z)-,2-hydroxyl (hydroxymethyl) ethyl ester(C21H40O4) ,and Di-n-octyl phthalate (C24H38O4 ). The results showed that the crude extract of the fungus cause the best mortality rate in the second instar larvae at concentrations of 3 and 5% after 72 hours of treatment when the mortality rates ranged between 60-100%. The mortality rates were directly proportional to the increase in concentration and time with a significant difference. The results also showed that the treatment of the food media was the most effective in affecting the larvae of flies, recording mortality rates that reached 100%, with a significant difference with direct spraying and dipping methods. These results reveal the significant efficacy of the tested secondary metabolite crude of m.anesopalae against Musca domestica which could be used as an ecofriendly alternative for insect control.