In this study, amount of morphine from poppy capsules (Papaver somniferum) was investigated using ultrasonic assisted extraction (UAE). Response surface methodology was used to estimate effective experimental conditions on the content extraction of poppy capsules. For this purpose, solvent/solid ratio (10-20 mL/500 mg sample), pH(1-13), time (30-60 min), and temperature (30-50 degrees C) were chosen as experimental variables. The affected response is extraction recovery values for morphine from poppy straw. For interpreting the relationship between experimental factors and response, a design table was established with combinations of three different concentrations levels of this compound in 29 trials. The second order quadratic model gave a satisfactory description of the experimental data. In our study, R-Squared (0.96), Adj-R-Squared (0.92), and Pred R-Squared (0.78) values for extraction yield display good accuracy of the derived model. The predicted optimal conditions for the highest morphine level (3.38 mg morphine/500 mg-sample) were found at 19.99 mL solvent/500 mg solid ratio, 59.94 min extraction time, 1.10 pH, and 42.36 degrees C temperature. In the optimal extraction conditions, the experimental values are very close to the predicted values. Consequently, the response surface modeling can be achieved sufficiently to predict extraction yield from poppy straw by ultrasound assisted extraction.