Morphine is the most widely known extract from the capsules of Papaver somniferum L. and it has been used since ancient times as analgesic, sedative and anesthetic agent. The opium poppies contain also other alkaloids in addition to morphine, such as codeine, noscapine, thebaine and papaverine.  The medicinal properties of these compounds are accompanied by strong addictive traits and their scaffold can be used as starting material for useful clinical medicine such as oxycodone, diamorphine, dihydrocodeine, etc. or illegal and dangerous drugs like heroin. 
Phytochemical Composition of Papaver Plants
Among all the Papaver species, Papaver somniferum L., also known as opium poppy, is the most rich in different types of alkaloids. Other phytochemicals contained in the genus are flavonols, anthocyanins and indole derivatives nudicaulins among other compounds. 
In addition to the renowned analgesic and narcotic effects, Papaver plants have a wide range of pharmacological properties including anticancer, antioxidant, antimicrobial and antidiabetic.
Opium poppies are highly produced illegally in countries such as Afghanistan, Mexico among others and legally grown in Turkey, Spain and Czechia.  Moreover varieties at low-morphine concentration can be grown for the production of seeds widely used in the food industry and for their high fiber content. 
The alkaloid composition varies greatly depending on the species, but also in the same cultivar. Opium poppies grow on a wide variety of soils, but the ones with a high-clay content can be relatively hard for the roots of young poppy plants. With a sufficient supply of water and a disposition in full sun it is possible to improve the alkaloid accumulation in the capsules.
Nevertheless alkaloid production is generally enhanced and induced by environmental stress conditions. For this reason the concentration of a specific alkaloid can be enhanced in drought periods, even if too little water can affect the morphine accumulation. 
Opium poppies are highly produced illegally in countries such as Afghanistan, Mexico among others and legally grown in Turkey, Spain and Czechia. 
Mechanism of Action of Morphine
Like other classic opioid analgesics, morphine has high affinity for the delta, kappa, and mu-opioid receptors. The latter is particularly expressed in the central and peripheral nervous system and the analgesic effects are exerted by morphine binding to it.
Morphine can activate descending inhibitory pathways of the central nervous system together with the inhibition of the neurons responsible for pain in the peripheral nervous system leading to an overall reduction of the nociceptive transmission.
Long-term morphine administration induces dysregulation at molecular and cellular levels in the brain, leading to addiction. For this reason, despite the wide use of opioids as analgesic medications, there is still a limited management of opioids disorders. 
It should be noticed that chronic exposure to morphine induces the phosphorylation of opioid receptors by G protein-coupled receptor kinases (GRKs), inducing a progressive desensitization of opioid receptors. This is the reason why chronic exposure to opioids leads to tolerance that is the decrease of the drug response.
Extraction of Morphine from Papaver Plants
Opium is the crude material retrieved from Papaver somniferum L. . After the flowering, when the petals fall down, the opium capsule containing a white latex stays. Opium capsules grow in a few weeks becoming bigger and they can be incised to retrieve the alkaloid containing milky liquid. The latex in the air becomes thicker and darker.
Morphine occurs naturally in opium and its concentration can vary from 9 to 17% by weight, depending on the Papaver species from which the latex is derived.
Friedrich Sertürner (1783-1841) was the first to isolate morphine from opium, discovering a new class of substances: the alkaloids. 
Alkaloids from opium can be extracted using water and oxalic acid. Nevertheless due to the poor solubility of alkaloids in water, the result is a large volume of water solution that has to be extracted with a large amount of organic solvents.
In fact traditional morphine extraction methods involve large amounts of hazardous and potentially toxic solvents such as chloroform and sulfur dioxide, prolonged extraction times, low efficiency and laborious procedures. The separation of morphine from other poppy derived alkaloids is time consuming and relatively complicated due to the characteristic of the substance.
Morphine can be more efficiently extracted refluxing opium in a basic alcoholic solution. In order to reach pH 9 it is possible to use inorganic bases such as sodium hydroxide, potassium hydroxide, ammonia, etc.
The mixture is filtered and the alcohol removed leaving a residue that can be further extracted with a basic aqueous solution with pH 11. The solution can be stirred, adding a sufficient amount of salt to avoid the formation of an emulsion. 
The solution at this point can be extracted with benzene or toluene. After that the pH of the solution can be adjusted to 8.5 or 9.5 in order for the morphine to precipitate from the mixture and be recovered. The lowering of the pH can be obtained treating the organic solution with an acid such as sulfuric acid, hydrochloric acid or acetic acid among others.
The precipitated morphine can be collected through filtration or decantation and the product can be washed with water prior to drying. This procedure is particularly efficient and cost-effective and the precipitation of the desired product can be conducted in one day. 
To recap the steps of a selective morphine extraction from opium these are the general steps to follow:
- Extracting opium with a basic alcoholic solution;
- Filtering and removing the alcoholic solution;
- The left material can be treated with basic aqueous solution (pH 11);
- Remove any solid matter after the aqueous extraction step;
- Stirring the basic aqueous extract with salt to avoid emulsions;
- Extracting the basic aqueous solution with a water-immiscible solvent to remove the non-morphine alkaloids from the solution;
- Adjust the pH of the basic aqueous solution to 8.5/9.5 in order to precipitate the morphine;
- Collect the precipitate and optionally further purified.
Determination of Morphine in Opium and Medicinal Preparations
Many techniques are available for the determination of opiates and their derivatives. Usually separation techniques are employed such as gas chromatography (GC) or high performance liquid chromatography (HPLC) or mass spectrometry (MS).
To make an example, through column chromatography it’s possible to separate other opium derived alkaloids from morphine. With simple absorption on a celite column wetted by an ammoniacal aqueous opium extract, it is possible to wash out other compounds different than morphine using benzene as mobile phase.
In the case of morphine determination in plasma or urine samples, many techniques have been developed. Most of them involve the use of solid phase extraction followed by GC-MS or HPLC. The latter method can be combined with dual-electrochemical/UV or fluorescence detection. 
GC-MS and HPLC don’t offer a fast quantification method capable of providing results in a short amount of time. For this reason there is always a need to find new methods capable of giving reliable on-site results.
Because the detection of drug abuse is of high interest for public safety, many efforts have been made to develop a fast-detecting technique for the accurate determination and quantitation of morphine in urine samples.
The method consists in a simple extraction process followed by derivatization using dansyl chloride and direct analysis by paper spray ionization (PCS) and a miniature MS spectrometer. Following this technique it’s possible to have the results on-site in 3 minutes.
The derivatization process permits to avoid the unpleasant formation of clusters of morphine fragments during the analysis with tandem mass spectrometer (MS/MS), permitting a more accurate quantification. In fact the formation of dansyl-morphine can produce highly abundant diagnostic ion product that can be easily detected, enhancing the sensitivity of the analysis of a 10 factor. 
 Bulduk I, Gezer B, Cengiz M. Optimization of Ultrasound-Assisted Extraction of Morphine from Capsules of Papaver somniferum by Response Surface Methodology. Int J Anal Chem. 2015;2015:796349. doi: 10.1155/2015/796349. Epub 2015 Mar 16. PMID: 25861273; PMCID: PMC4378338.
 Butnariu M, Quispe C, Herrera-Bravo J, Pentea M, Sarac I, Küşümler AS, Özçelik B, Painuli S, Semwal P, Imran M, Gondal TA, Emamzadeh-Yazdi S, Lapava N, Yousaf Z, Kumar M, Eid AH, Al-Dhaheri Y, Suleria HAR, Del Mar Contreras M, Sharifi-Rad J, Cho WC. Papaver Plants: Current Insights on Phytochemical and Nutritional Composition Along with Biotechnological Applications. Oxid Med Cell Longev. 2022 Feb 3;2022:2041769. doi: 10.1155/2022/2041769. PMID: 36824615; PMCID: PMC9943628.
 Melo D, Álvarez-Ortí M, Nunes MA, Espírito Santo L, Machado S, Pardo JE, Oliveira MBPP. Nutritional and Chemical Characterization of Poppy Seeds, Cold-Pressed Oil, and Cake: Poppy Cake as a High-Fibre and High-Protein Ingredient for Novel Food Production. Foods. 2022 Sep 29;11(19):3027. doi: 10.3390/foods11193027. PMID: 36230103; PMCID: PMC9562219.
 Ngernsaengsaruay, C.; Leksungnoen, N.; Chanton, P.; Andriyas, T.; Thaweekun, P.; Rueansri, S.; Tuntianupong, R.; Hauyluek, W. Morphology, Taxonomy, Anatomy, and Palynology of the Opium Poppy (Papaver somniferum L.) Cultivation in Northern Thailand. Plants 2023, 12, 2105.
 Manqing Kang, Jinfeng Xue, Yurong Zhang, Zheng Ouyang, Wenpeng Zhang,On-site quantitation of morphine in urine by fast derivatization and miniature mass spectrometry analysis, Green Analytical Chemistry, Volume 1, 2022.
 Listos J, Łupina M, Talarek S, Mazur A, Orzelska-Górka J, Kotlińska J. The Mechanisms Involved in Morphine Addiction: An Overview. Int J Mol Sci. 2019 Sep 3;20(17):4302. doi: 10.3390/ijms20174302. PMID: 31484312; PMCID: PMC6747116.