Diabetes is one of the most dangerous diseases in the world today. Recently, there are many ways to treat this disease in the world. In traditional Iranian medicine, this herb is used to treat diabetes, fever, malaria and toothache. Also, in clinical and experimental studies, there have been cases of relief, arthritis effects and anti-inflammatory peroxidation. Otostegia persica is composed of numerous compounds, but the main medicinal properties, including the antioxidant property and the hypoglycemic effect of this plant, have an important role in increasing blood insuline secretion and, consequently, the improvement of diabetes mellitus. In addition, the hydroalcoholic extract improves the leave morphine syndrome. It has been reported that polyphenolic antioxidants in some plants are useful in the improvement of diabetes complications. In this reesearch, the extraction of flavonoid from otostegia persica was investigated by Soxhlet extraction methanol solvent and modified supercritical CO 2 with methanol as solvent in 30 min of static time. The analysis showed that the experimental data obtained were well fitted by a second-order polynomial model. In addition, it was charaterized that the linear terms of each of the four variables are of great importance in the response of the model. Time square term is very important, and other variables are also important Design of experiment was executed with response surface methodology (RSM) using Mini Tab software 17. The operating temperature (40–60 ), pressure (15–35 MPa),dynamic extraction time (60–120 min) and CO2 flow rate (0.8–2 ml/min) were regarded as the range of operating variables. Density and viscosity of dense gases mixture was obtained by Peng-Robion (PR) equation of state with the van der Waals mixing rules and Chung et al., respectively. Mathematical model parameters are including effective pore diffusivity, film mass transfer coefficient, axial dispersion, and distribution coefficient. The first three parameters were obtained from empirical equations and the distribution coefficient between solid and solvent has been determined by thermodynamic modeling of solubilities. UV test was appledy to recognize and quantitatively determine the amount of extracted flavonoid. Response surface analysis proved that R 2 and modified R 2 of the model were 98%and 96%, respectively. The RSM modeling prophesy the optimal operating conditions to be the pressure of 24.5 MPa, temperature of 43.5 , CO 2 flow rate of 1.8 ml/min and dynamic extraction time of 109 min in which the maximum flavonoid recovery was obtained to be 0.86. This optimization was also performed with genetic algorithm (GA) and these results were obtained: pressure 24.9 Mpa, temperature 41 ,flow rate 1.9 ml/min and dynamic time 119 min. Key words Otostegia persica, flavonoid, supercritical extraction, Response Surface Methodology, Meth-solvent, GA.