Morphine belongs to a class of medications called opiate (narcotic) analgesics. It works by changing the way the brain and…